pub enum BuiltInFn {
Native(NativeFn),
Plugin(Box<dyn Fn(&mut EvalContext, JsValue, Vec<JsValue>) -> Result<JsValue, JErrorType> + Send + Sync>),
Script(Rc<FunctionData>),
}Expand description
Built-in function - either compiled-in or plugin-provided.
Variants§
Native(NativeFn)
Direct function pointer - zero overhead for compiled-in functions.
Plugin(Box<dyn Fn(&mut EvalContext, JsValue, Vec<JsValue>) -> Result<JsValue, JErrorType> + Send + Sync>)
Plugin-provided function - small vtable indirection cost.
Script(Rc<FunctionData>)
JavaScript implementation - interpreted at runtime.
Implementations§
Auto Trait Implementations§
impl Freeze for BuiltInFn
impl !RefUnwindSafe for BuiltInFn
impl !Send for BuiltInFn
impl !Sync for BuiltInFn
impl Unpin for BuiltInFn
impl !UnwindSafe for BuiltInFn
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