pub struct ModuleLoader { /* private fields */ }Expand description
Loads routing modules by content hash, deduplicating identical bytecode.
Backed by an in-memory HashMap keyed by content hash, not a beamr module
registry; the bytecode is hashed for dedup only and is never executed.
Loading the same content hash twice returns a handle to the already-loaded
module rather than loading it again.
Implementations§
Source§impl ModuleLoader
impl ModuleLoader
Sourcepub fn load(&self, module: RoutingModule) -> RoutingFunction
pub fn load(&self, module: RoutingModule) -> RoutingFunction
Loads module, returning an executable routing function.
If a module with the same content hash is already loaded, the existing module is reused and no duplicate is loaded.
Sourcepub fn loaded_count(&self) -> usize
pub fn loaded_count(&self) -> usize
Returns the number of distinct modules currently loaded.
Sourcepub fn is_loaded(&self, hash: ContentHash) -> bool
pub fn is_loaded(&self, hash: ContentHash) -> bool
Returns true when a module with hash is loaded.
Trait Implementations§
Source§impl Debug for ModuleLoader
impl Debug for ModuleLoader
Source§impl Default for ModuleLoader
impl Default for ModuleLoader
Source§fn default() -> ModuleLoader
fn default() -> ModuleLoader
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for ModuleLoader
impl RefUnwindSafe for ModuleLoader
impl Send for ModuleLoader
impl Sync for ModuleLoader
impl Unpin for ModuleLoader
impl UnsafeUnpin for ModuleLoader
impl UnwindSafe for ModuleLoader
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