Trait arithmetic_eval::fns::IntoEvalResult
source · 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 Number
s, Function
s, Value
s),
for two container types: vectors and tuples, and for Result
s with the error type
convertible to ErrorOutput
.
Required Methods§
sourcefn into_eval_result(self) -> Result<Value<T>, ErrorOutput>
fn into_eval_result(self) -> Result<Value<T>, ErrorOutput>
Performs the conversion.