pub struct Evaluator<'m> { /* private fields */ }Implementations§
Source§impl<'m> Evaluator<'m>
impl<'m> Evaluator<'m>
Sourcepub fn why_not(
&self,
name: &str,
from: &State,
to: &State,
) -> Result<Vec<Blocked>>
pub fn why_not( &self, name: &str, from: &State, to: &State, ) -> Result<Vec<Blocked>>
The actions that came closest to permitting from -> to, closest
first.
Empty when the step is allowed. Every action other than the one taken fails at such a step, and reporting those would be noise rather than a diagnosis.
Source§impl<'m> Evaluator<'m>
impl<'m> Evaluator<'m>
Sourcepub fn new(spec: &'m Spec, constants: BTreeMap<String, Value>) -> Result<Self>
pub fn new(spec: &'m Spec, constants: BTreeMap<String, Value>) -> Result<Self>
Every declared constant must be given a value; a specification with a free constant has no determinate meaning at a state.
Sourcepub fn holds_at(&self, name: &str, state: &State) -> Result<bool>
pub fn holds_at(&self, name: &str, state: &State) -> Result<bool>
Does the named state predicate hold at state?
Sourcepub fn step_allowed(&self, name: &str, from: &State, to: &State) -> Result<bool>
pub fn step_allowed(&self, name: &str, from: &State, to: &State) -> Result<bool>
Is from -> to a step the named action permits?
pub fn value_of(&self, name: &str, state: &State) -> Result<Value>
pub fn eval_at( &self, expr: &'m Expr, from: &State, to: Option<&State>, ) -> Result<Value>
Trait Implementations§
Auto Trait Implementations§
impl<'m> Freeze for Evaluator<'m>
impl<'m> RefUnwindSafe for Evaluator<'m>
impl<'m> Send for Evaluator<'m>
impl<'m> Sync for Evaluator<'m>
impl<'m> Unpin for Evaluator<'m>
impl<'m> UnsafeUnpin for Evaluator<'m>
impl<'m> UnwindSafe for Evaluator<'m>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more