Trait puffin::algebra::term::TermType

source ·
pub trait TermType<PT: ProtocolTypes>:
    Display
    + Debug
    + Clone {
Show 13 methods // Required methods fn resistant_id(&self) -> u32; fn size(&self) -> usize; fn is_leaf(&self) -> bool; fn get_type_shape(&self) -> &TypeShape<PT>; fn name(&self) -> &str; fn mutate(&mut self, other: Self); fn display_at_depth(&self, depth: usize) -> String; fn is_symbolic(&self) -> bool; fn make_symbolic(&mut self); fn evaluate_config<PB>( &self, context: &TraceContext<PB>, with_payloads: bool, ) -> Result<(ConcreteMessage, Box<dyn EvaluatedTerm<PT>>), Error> where PB: ProtocolBehavior<ProtocolTypes = PT> + ProtocolBehavior; // Provided methods fn evaluate<PB>( &self, ctx: &TraceContext<PB>, ) -> Result<ConcreteMessage, Error> where PB: ProtocolBehavior<ProtocolTypes = PT> + ProtocolBehavior { ... } fn evaluate_symbolic<PB>( &self, ctx: &TraceContext<PB>, ) -> Result<ConcreteMessage, Error> where PB: ProtocolBehavior<ProtocolTypes = PT> + ProtocolBehavior { ... } fn evaluate_dy<PB>( &self, ctx: &TraceContext<PB>, ) -> Result<Box<dyn EvaluatedTerm<PT>>, Error> where PB: ProtocolBehavior<ProtocolTypes = PT> + ProtocolBehavior { ... }
}
Expand description

Trait for data we can treat as terms (either DYTerm or Term)

Required Methods§

source

fn resistant_id(&self) -> u32

source

fn size(&self) -> usize

source

fn is_leaf(&self) -> bool

source

fn get_type_shape(&self) -> &TypeShape<PT>

source

fn name(&self) -> &str

source

fn mutate(&mut self, other: Self)

source

fn display_at_depth(&self, depth: usize) -> String

source

fn is_symbolic(&self) -> bool

source

fn make_symbolic(&mut self)

source

fn evaluate_config<PB>( &self, context: &TraceContext<PB>, with_payloads: bool, ) -> Result<(ConcreteMessage, Box<dyn EvaluatedTerm<PT>>), Error>
where PB: ProtocolBehavior<ProtocolTypes = PT> + ProtocolBehavior,

Evaluate terms into ConcreteMessage and EvaluatedTerm (considering Payloads or not depending on with_payloads) With with_payloads, the returned EvaluatedTermis without payload replacements; use theConcreteMessage` instead.

Provided Methods§

source

fn evaluate<PB>(&self, ctx: &TraceContext<PB>) -> Result<ConcreteMessage, Error>
where PB: ProtocolBehavior<ProtocolTypes = PT> + ProtocolBehavior,

Evaluate terms into ConcreteMessage (considering Payloads)

source

fn evaluate_symbolic<PB>( &self, ctx: &TraceContext<PB>, ) -> Result<ConcreteMessage, Error>
where PB: ProtocolBehavior<ProtocolTypes = PT> + ProtocolBehavior,

Evaluate terms into ConcreteMessage considering all sub-terms as symbolic (even those with Payloads)

source

fn evaluate_dy<PB>( &self, ctx: &TraceContext<PB>, ) -> Result<Box<dyn EvaluatedTerm<PT>>, Error>
where PB: ProtocolBehavior<ProtocolTypes = PT> + ProtocolBehavior,

Evaluate terms into EvaluatedTerm considering all sub-terms as symbolic (even those with Payloads)

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<PT: ProtocolTypes> TermType<PT> for Term<PT>