[][src]Enum arithmetic_eval::Value

pub enum Value<'a, T> where
    T: Grammar
{ Number(T::Lit), Bool(bool), Function(Function<'a, T>), Tuple(Vec<Value<'a, T>>), }

Values produced by expressions during their interpretation.

Variants

Number(T::Lit)

Primitive value: a single literal.

Bool(bool)

Boolean value.

Function(Function<'a, T>)

Function.

Tuple(Vec<Value<'a, T>>)

Tuple of zero or more values.

Implementations

impl<'a, T: Grammar> Value<'a, T>[src]

pub fn native_fn(function: impl NativeFn<T> + 'static) -> Self[src]

Creates a value for a native function.

pub fn void() -> Self[src]

Creates a void value (an empty tuple).

pub fn is_void(&self) -> bool[src]

Checks if the value is void.

pub fn is_function(&self) -> bool[src]

Checks if this value is a function.

Trait Implementations

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

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

impl<'_, T: Grammar> PartialEq<Value<'_, T>> for Value<'_, T> where
    T::Lit: PartialEq
[src]

Auto Trait Implementations

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

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

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

impl<'a, T> Unpin for Value<'a, T> where
    <T as Grammar>::Lit: Unpin

impl<'a, T> !UnwindSafe for Value<'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.