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§
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)
sourcefn evaluate_config<PB>(
&self,
context: &TraceContext<PB>,
with_payloads: bool,
) -> Result<(ConcreteMessage, Box<dyn EvaluatedTerm<PT>>), Error>where
PB: ProtocolBehavior<ProtocolTypes = PT> + ProtocolBehavior,
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 the
ConcreteMessage` instead.
Provided Methods§
sourcefn evaluate<PB>(&self, ctx: &TraceContext<PB>) -> Result<ConcreteMessage, Error>where
PB: ProtocolBehavior<ProtocolTypes = PT> + ProtocolBehavior,
fn evaluate<PB>(&self, ctx: &TraceContext<PB>) -> Result<ConcreteMessage, Error>where
PB: ProtocolBehavior<ProtocolTypes = PT> + ProtocolBehavior,
Evaluate terms into ConcreteMessage
(considering Payloads)
sourcefn evaluate_symbolic<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,
Evaluate terms into ConcreteMessage
considering all sub-terms as symbolic (even those with
Payloads)
sourcefn evaluate_dy<PB>(
&self,
ctx: &TraceContext<PB>,
) -> Result<Box<dyn EvaluatedTerm<PT>>, 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,
Evaluate terms into EvaluatedTerm
considering all sub-terms as symbolic (even those with
Payloads)
Object Safety§
This trait is not object safe.