pub struct HostRegistry { /* private fields */ }Expand description
Host function registry.
Implementations§
Source§impl HostRegistry
impl HostRegistry
Sourcepub fn register_module<M, N, F>(&mut self, module: M, name: N, f: F)
pub fn register_module<M, N, F>(&mut self, module: M, name: N, f: F)
Register a host function in a module namespace.
Sourcepub fn get_module(&self, module: &str, name: &str) -> Option<&HostFn>
pub fn get_module(&self, module: &str, name: &str) -> Option<&HostFn>
Look up a module function.
Sourcepub fn function_names(&self) -> impl Iterator<Item = &String>
pub fn function_names(&self) -> impl Iterator<Item = &String>
Get all registered function names.
Sourcepub fn module_names(&self) -> impl Iterator<Item = &String>
pub fn module_names(&self) -> impl Iterator<Item = &String>
Get all registered module names.
Sourcepub fn merge(&mut self, other: HostRegistry)
pub fn merge(&mut self, other: HostRegistry)
Merge another registry into this one.
Trait Implementations§
Source§impl Clone for HostRegistry
impl Clone for HostRegistry
Source§fn clone(&self) -> HostRegistry
fn clone(&self) -> HostRegistry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HostRegistry
impl Debug for HostRegistry
Source§impl Default for HostRegistry
impl Default for HostRegistry
Source§fn default() -> HostRegistry
fn default() -> HostRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for HostRegistry
impl !RefUnwindSafe for HostRegistry
impl Send for HostRegistry
impl Sync for HostRegistry
impl Unpin for HostRegistry
impl !UnwindSafe for HostRegistry
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