pub trait IntoEvalResult<T> {
    // Required method
    fn into_eval_result(self) -> Result<Value<T>, ErrorOutput>;
}
Expand description

Converts type into Value or an error. This is used to convert the return type of wrapped functions to the result expected by NativeFn.

Unlike with TryInto trait from the standard library, the erroneous result here does not mean that the conversion itself is impossible. Rather, it means that the function evaluation has failed for the provided args.

This trait is implemented for base value types (such as Numbers, Functions, Values), for two container types: vectors and tuples, and for Results with the error type convertible to ErrorOutput.

Required Methods§

source

fn into_eval_result(self) -> Result<Value<T>, ErrorOutput>

Performs the conversion.

Implementations on Foreign Types§

source§

impl<Num, T, U> IntoEvalResult<Num> for (T, U)where T: IntoEvalResult<Num>, U: IntoEvalResult<Num>,

source§

impl<U, T> IntoEvalResult<T> for Vec<U>where U: IntoEvalResult<T>,

source§

impl<T, U> IntoEvalResult<T> for Result<U, Error>where U: IntoEvalResult<T>,

source§

impl<Num, T> IntoEvalResult<Num> for (T,)where T: IntoEvalResult<Num>,

source§

impl<Num, T, U, V, W, X, Y, Z, A, B> IntoEvalResult<Num> for (T, U, V, W, X, Y, Z, A, B)where T: IntoEvalResult<Num>, U: IntoEvalResult<Num>, V: IntoEvalResult<Num>, W: IntoEvalResult<Num>, X: IntoEvalResult<Num>, Y: IntoEvalResult<Num>, Z: IntoEvalResult<Num>, A: IntoEvalResult<Num>, B: IntoEvalResult<Num>,

source§

impl<T> IntoEvalResult<T> for ()

source§

impl<T> IntoEvalResult<T> for bool

source§

impl<Num, T, U, V, W, X, Y, Z> IntoEvalResult<Num> for (T, U, V, W, X, Y, Z)where T: IntoEvalResult<Num>, U: IntoEvalResult<Num>, V: IntoEvalResult<Num>, W: IntoEvalResult<Num>, X: IntoEvalResult<Num>, Y: IntoEvalResult<Num>, Z: IntoEvalResult<Num>,

source§

impl<Num, T, U, V, W, X, Y, Z, A, B, C> IntoEvalResult<Num> for (T, U, V, W, X, Y, Z, A, B, C)where T: IntoEvalResult<Num>, U: IntoEvalResult<Num>, V: IntoEvalResult<Num>, W: IntoEvalResult<Num>, X: IntoEvalResult<Num>, Y: IntoEvalResult<Num>, Z: IntoEvalResult<Num>, A: IntoEvalResult<Num>, B: IntoEvalResult<Num>, C: IntoEvalResult<Num>,

source§

impl<T> IntoEvalResult<T> for Ordering

source§

impl<Num, T, U, V, W> IntoEvalResult<Num> for (T, U, V, W)where T: IntoEvalResult<Num>, U: IntoEvalResult<Num>, V: IntoEvalResult<Num>, W: IntoEvalResult<Num>,

source§

impl<Num, T, U, V, W, X> IntoEvalResult<Num> for (T, U, V, W, X)where T: IntoEvalResult<Num>, U: IntoEvalResult<Num>, V: IntoEvalResult<Num>, W: IntoEvalResult<Num>, X: IntoEvalResult<Num>,

source§

impl<Num, T, U, V, W, X, Y> IntoEvalResult<Num> for (T, U, V, W, X, Y)where T: IntoEvalResult<Num>, U: IntoEvalResult<Num>, V: IntoEvalResult<Num>, W: IntoEvalResult<Num>, X: IntoEvalResult<Num>, Y: IntoEvalResult<Num>,

source§

impl<T, U> IntoEvalResult<T> for Result<U, String>where U: IntoEvalResult<T>,

source§

impl<Num, T, U, V, W, X, Y, Z, A> IntoEvalResult<Num> for (T, U, V, W, X, Y, Z, A)where T: IntoEvalResult<Num>, U: IntoEvalResult<Num>, V: IntoEvalResult<Num>, W: IntoEvalResult<Num>, X: IntoEvalResult<Num>, Y: IntoEvalResult<Num>, Z: IntoEvalResult<Num>, A: IntoEvalResult<Num>,

source§

impl<Num, T, U, V> IntoEvalResult<Num> for (T, U, V)where T: IntoEvalResult<Num>, U: IntoEvalResult<Num>, V: IntoEvalResult<Num>,

Implementors§

source§

impl<T> IntoEvalResult<T> for Function<T>

source§

impl<T> IntoEvalResult<T> for Value<T>

source§

impl<T> IntoEvalResult<T> for Object<T>

source§

impl<T> IntoEvalResult<T> for Tuple<T>

source§

impl<T: Number> IntoEvalResult<T> for T