pub struct FunctionTable { /* private fields */ }Expand description
The global function table.
Maps function indices to their entries. Built during compilation and used at runtime for function dispatch.
Implementations§
Source§impl FunctionTable
impl FunctionTable
Sourcepub fn with_capacity(cap: usize) -> Self
pub fn with_capacity(cap: usize) -> Self
Create with pre-allocated capacity.
Sourcepub fn register(&mut self, entry: FunctionEntry) -> FnPtr
pub fn register(&mut self, entry: FunctionEntry) -> FnPtr
Register a new function and return its pointer.
Sourcepub fn get(&self, ptr: FnPtr) -> Option<&FunctionEntry>
pub fn get(&self, ptr: FnPtr) -> Option<&FunctionEntry>
Look up a function entry by pointer.
Sourcepub fn get_by_name(&self, name: &str) -> Option<(FnPtr, &FunctionEntry)>
pub fn get_by_name(&self, name: &str) -> Option<(FnPtr, &FunctionEntry)>
Look up a function entry by name.
Sourcepub fn iter(&self) -> impl Iterator<Item = (FnPtr, &FunctionEntry)>
pub fn iter(&self) -> impl Iterator<Item = (FnPtr, &FunctionEntry)>
Iterate over all entries.
Sourcepub fn register_builtins(&mut self)
pub fn register_builtins(&mut self)
Register built-in functions.
Trait Implementations§
Source§impl Debug for FunctionTable
impl Debug for FunctionTable
Auto Trait Implementations§
impl Freeze for FunctionTable
impl RefUnwindSafe for FunctionTable
impl Send for FunctionTable
impl Sync for FunctionTable
impl Unpin for FunctionTable
impl UnsafeUnpin for FunctionTable
impl UnwindSafe for FunctionTable
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