Enum arithmetic_eval::Function
source · pub enum Function<T> {
Native(Arc<dyn NativeFn<T>>),
Interpreted(Arc<InterpretedFn<T>>),
}
Expand description
Function definition. Functions can be either native (defined in the Rust code) or defined in the interpreter.
Variants§
Native(Arc<dyn NativeFn<T>>)
Native function.
Interpreted(Arc<InterpretedFn<T>>)
Interpreted function.
Implementations§
source§impl<T: 'static + Clone> Function<T>
impl<T: 'static + Clone> Function<T>
sourcepub fn evaluate(
&self,
args: Vec<SpannedValue<T>>,
ctx: &mut CallContext<'_, T>,
) -> EvalResult<T>
pub fn evaluate( &self, args: Vec<SpannedValue<T>>, ctx: &mut CallContext<'_, T>, ) -> EvalResult<T>
Evaluates the function on the specified arguments.
Trait Implementations§
source§impl<T> IntoEvalResult<T> for Function<T>
impl<T> IntoEvalResult<T> for Function<T>
source§fn into_eval_result(self) -> Result<Value<T>, ErrorOutput>
fn into_eval_result(self) -> Result<Value<T>, ErrorOutput>
Performs the conversion.
source§impl<T: PartialEq> PartialEq for Function<T>
impl<T: PartialEq> PartialEq for Function<T>
source§impl<T> TryFromValue<T> for Function<T>
impl<T> TryFromValue<T> for Function<T>
source§fn try_from_value(value: Value<T>) -> Result<Self, FromValueError>
fn try_from_value(value: Value<T>) -> Result<Self, FromValueError>
Attempts to convert
value
to a type supported by the function.Auto Trait Implementations§
impl<T> Freeze for Function<T>
impl<T> !RefUnwindSafe for Function<T>
impl<T> !Send for Function<T>
impl<T> !Sync for Function<T>
impl<T> Unpin for Function<T>
impl<T> !UnwindSafe for Function<T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)