Struct rhai::FnPtr [−][src]
pub struct FnPtr(_, _);
Expand description
A general function pointer, which may carry additional (i.e. curried) argument values to be passed onto a function during a call.
Implementations
Create a new function pointer.
Set curried arguments to the function pointer.
Is the function pointer curried?
Get the number of curried arguments.
Does the function pointer refer to an anonymous function?
Not available under no_function
.
pub fn call_dynamic(
&self,
ctx: &NativeCallContext<'_>,
this_ptr: Option<&mut Dynamic>,
arg_values: impl AsMut<[Dynamic]>
) -> Result<Dynamic, Box<EvalAltResult>>
pub fn call_dynamic(
&self,
ctx: &NativeCallContext<'_>,
this_ptr: Option<&mut Dynamic>,
arg_values: impl AsMut<[Dynamic]>
) -> Result<Dynamic, Box<EvalAltResult>>
Call the function pointer with curried arguments (if any).
If this function is a script-defined function, it must not be marked private.
WARNING
All the arguments are consumed, meaning that they’re replaced by ()
.
This is to avoid unnecessarily cloning the arguments.
Do not use the arguments after this call. If they are needed afterwards,
clone them before calling this function.
Trait Implementations
type Error = Box<EvalAltResult>
type Error = Box<EvalAltResult>
The type returned in the event of a conversion error.
Performs the conversion.
type Error = Box<EvalAltResult>
type Error = Box<EvalAltResult>
The type returned in the event of a conversion error.
Performs the conversion.
Auto Trait Implementations
impl !RefUnwindSafe for FnPtr
impl !UnwindSafe for FnPtr
Blanket Implementations
Mutably borrows from an owned value. Read more