pub enum FunctionBody {
Pointer(fn(&mut Context, &Registry)),
Closure(Arc<dyn Fn(&mut Context, &Registry) + Send + Sync>),
}Expand description
The code a function runs.
Both variants take the context to move data through and the registry to look up anything else they need to call.
Variants§
Pointer(fn(&mut Context, &Registry))
A plain function pointer.
Closure(Arc<dyn Fn(&mut Context, &Registry) + Send + Sync>)
A closure, for bodies that capture state such as a compiled script.
Implementations§
Source§impl FunctionBody
impl FunctionBody
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for FunctionBody
impl !UnwindSafe for FunctionBody
impl Freeze for FunctionBody
impl Send for FunctionBody
impl Sync for FunctionBody
impl Unpin for FunctionBody
impl UnsafeUnpin for FunctionBody
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