[][src]Enum arithmetic_eval::Function

pub enum Function<'a, T> where
    T: Grammar
{ Native(Rc<dyn NativeFn<T>>), Interpreted(Rc<InterpretedFn<'a, T>>), }

Function definition. Functions can be either native (defined in the Rust code) or defined in the interpreter.

Variants

Native(Rc<dyn NativeFn<T>>)

Native function.

Interpreted(Rc<InterpretedFn<'a, T>>)

Interpreted function.

Implementations

impl<'_, T: Grammar> Function<'_, T>[src]

pub fn is_same_function(&self, other: &Self) -> bool[src]

Checks if the provided function is the same as this one.

impl<'a, T> Function<'a, T> where
    T: Grammar,
    T::Lit: Num + Neg<Output = T::Lit> + Pow<T::Lit, Output = T::Lit>, 
[src]

pub fn evaluate(
    &self,
    args: Vec<SpannedValue<'a, T>>,
    ctx: &mut CallContext<'_, 'a>
) -> EvalResult<'a, T>
[src]

Evaluates the function on the specified arguments.

Trait Implementations

impl<'_, T: Grammar> Clone for Function<'_, T>[src]

impl<'a, T: Debug> Debug for Function<'a, T> where
    T: Grammar
[src]

Auto Trait Implementations

impl<'a, T> !RefUnwindSafe for Function<'a, T>

impl<'a, T> !Send for Function<'a, T>

impl<'a, T> !Sync for Function<'a, T>

impl<'a, T> Unpin for Function<'a, T>

impl<'a, T> !UnwindSafe for Function<'a, T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.