pub struct NativeFunction { /* private fields */ }
Implementations
sourceimpl NativeFunction
impl NativeFunction
pub fn new(
signature: Signature,
defaults: Option<Box<[Variant]>>,
env: Gc<GlobalEnv>,
func: NativeFn
) -> Self
pub fn signature(&self) -> &Signature
pub fn env(&self) -> Gc<GlobalEnv>
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
sourceimpl From<NativeFunction> for Variant
impl From<NativeFunction> for Variant
sourcefn from(func: NativeFunction) -> Self
fn from(func: NativeFunction) -> Self
Converts to this type from the input type.
sourceimpl GcTrace for NativeFunction
impl GcTrace for NativeFunction
Auto Trait Implementations
impl !RefUnwindSafe for NativeFunction
impl !Send for NativeFunction
impl !Sync for NativeFunction
impl Unpin for NativeFunction
impl !UnwindSafe for NativeFunction
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more