Struct muse_lang::runtime::value::StaticRustFunctionTable
source · pub struct StaticRustFunctionTable<T>(/* private fields */);Expand description
A statically defined RustFunctionTable.
Implementations§
source§impl<T> StaticRustFunctionTable<T>
impl<T> StaticRustFunctionTable<T>
sourcepub const fn new(
init: fn(_: RustFunctionTable<T>) -> RustFunctionTable<T>,
) -> Self
pub const fn new( init: fn(_: RustFunctionTable<T>) -> RustFunctionTable<T>, ) -> Self
Returns a new static function table that initializes itself using
init.
Methods from Deref<Target = RustFunctionTable<T>>§
sourcepub fn invoke(
&self,
vm: &mut VmContext<'_, '_>,
name: &SymbolRef,
arity: Arity,
this: &Rooted<T>,
) -> Result<Value, Fault>
pub fn invoke( &self, vm: &mut VmContext<'_, '_>, name: &SymbolRef, arity: Arity, this: &Rooted<T>, ) -> Result<Value, Fault>
Invokes a function named name with arity arguments.
§Errors
Fault::UnknownSymbol: Returned if this table has no functions with the given name.Fault::IncorrectNumberOfArguments: Returned if no functions with the given name accept the given number of arguments.
Trait Implementations§
source§impl<T> Deref for StaticRustFunctionTable<T>where
T: CustomType + Trace,
impl<T> Deref for StaticRustFunctionTable<T>where
T: CustomType + Trace,
Auto Trait Implementations§
impl<T> !Freeze for StaticRustFunctionTable<T>
impl<T> !RefUnwindSafe for StaticRustFunctionTable<T>
impl<T> Send for StaticRustFunctionTable<T>
impl<T> Sync for StaticRustFunctionTable<T>
impl<T> Unpin for StaticRustFunctionTable<T>
impl<T> !UnwindSafe for StaticRustFunctionTable<T>
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