TermType

Trait TermType 

Source
pub trait TermType<PT: ProtocolTypes>:
    Display
    + Debug
    + Clone {
Show 15 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 get(&self, path: &[usize]) -> Result<&Self, Error>; fn evaluate_config<PB: ProtocolBehavior<ProtocolTypes = PT>>( &self, context: &TraceContext<PB>, with_payloads: bool, ) -> Result<(ConcreteMessage, Box<dyn EvaluatedTerm<PT>>), Error>; // Provided methods fn evaluate_config_wrap<PB: ProtocolBehavior<ProtocolTypes = PT>>( &self, context: &TraceContext<PB>, with_payloads: bool, ) -> Result<(ConcreteMessage, Box<dyn EvaluatedTerm<PT>>), Error> { ... } fn evaluate<PB: ProtocolBehavior<ProtocolTypes = PT>>( &self, ctx: &TraceContext<PB>, ) -> Result<ConcreteMessage, Error> { ... } fn evaluate_symbolic<PB: ProtocolBehavior<ProtocolTypes = PT>>( &self, ctx: &TraceContext<PB>, ) -> Result<ConcreteMessage, Error> { ... } fn evaluate_dy<PB: ProtocolBehavior<ProtocolTypes = PT>>( &self, ctx: &TraceContext<PB>, ) -> Result<Box<dyn EvaluatedTerm<PT>>, Error> { ... }
}
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 get(&self, path: &[usize]) -> Result<&Self, Error>

Source

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

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_config_wrap<PB: ProtocolBehavior<ProtocolTypes = PT>>( &self, context: &TraceContext<PB>, with_payloads: bool, ) -> Result<(ConcreteMessage, Box<dyn EvaluatedTerm<PT>>), Error>

Wrap evaluate_config with error stats and logging handling

Source

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

Evaluate terms into ConcreteMessage (considering Payloads)

Source

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

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

Source

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

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

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