use std::{default, fmt::Display}; use log::info; #[derive(Clone, Copy)] pub enum ProofType { Body, And, Predicate, } impl Display for ProofType { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { ProofType::Body => write!(f, "body_prover"), ProofType::And => write!(f, "and_prover"), ProofType::Predicate => write!(f, "predicate_prover"), } } } pub trait Tracer { fn begin_proof(&self, proof_type: ProofType) -> Self; fn print_step(&self, show: T); fn end_proof(self); } pub struct SimpleTracer { proof_type: ProofType, } impl SimpleTracer { pub fn new(proof_type: ProofType) -> Self { Self { proof_type } } } impl Tracer for SimpleTracer { fn begin_proof(&self, proof_type: ProofType) -> Self { SimpleTracer { proof_type } } fn print_step(&self, show: T) { let str = format!("{}", self.proof_type); info!(target: &str, "{}", show); } fn end_proof(self) { todo!() } }