FuncImpl

Trait FuncImpl 

Source
pub trait FuncImpl: HasFuncSignature {
    // Required method
    fn evaluate(
        &self,
        state: &mut InterpreterState<'_>,
        args: Vec<TermReference>,
    ) -> (TermReference, NewlyEvaluatedTerms);
}
Expand description

Trait for primitive function implementations.

Required Methods§

Source

fn evaluate( &self, state: &mut InterpreterState<'_>, args: Vec<TermReference>, ) -> (TermReference, NewlyEvaluatedTerms)

Given a handle on the current InterpreterState (primarily useful if additional terms need to be evaluated / looked up) and the collection of TermReference arguments to apply this function implementation to, yields a TermReference to the result, along with a collection of any NewlyEvaluatedTerms which may have arisen as part of the implementation of this method. See func_impl.rs in the source for sample implementations.

Trait Implementations§

Source§

impl Hash for dyn FuncImpl + '_

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
Source§

impl PartialEq for dyn FuncImpl + '_

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for dyn FuncImpl + '_

Implementors§