pub struct NativeFunction { /* private fields */ }
Implementations§
Source§impl NativeFunction
impl NativeFunction
pub fn new( signature: Signature, defaults: Option<Box<[Variant]>>, env: Gc<NamespaceEnv>, func: NativeFn, ) -> Self
pub fn signature(&self) -> &Signature
pub fn env(&self) -> Gc<NamespaceEnv>
pub fn defaults(&self) -> &[Variant]
Sourcepub fn exec_fun(
&self,
vm: &mut VirtualMachine<'_>,
args: &[Variant],
) -> ExecResult<Variant>
pub fn exec_fun( &self, vm: &mut VirtualMachine<'_>, args: &[Variant], ) -> ExecResult<Variant>
actually execute a native function
Trait Implementations§
Source§impl Debug for NativeFunction
impl Debug for NativeFunction
Source§impl From<NativeFunction> for Variant
impl From<NativeFunction> for Variant
Source§fn from(func: NativeFunction) -> Self
fn from(func: NativeFunction) -> Self
Converts to this type from the input type.
Source§impl GcTrace for NativeFunction
impl GcTrace for NativeFunction
Auto Trait Implementations§
impl Freeze for NativeFunction
impl !RefUnwindSafe for NativeFunction
impl !Send for NativeFunction
impl !Sync for NativeFunction
impl Unpin for NativeFunction
impl !UnwindSafe for NativeFunction
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