pub struct ModuleRegistry { /* private fields */ }Expand description
What a module registers into during startup.
Implementations§
Source§impl ModuleRegistry
impl ModuleRegistry
Sourcepub fn provide<T: Send + Sync + 'static>(&mut self, service: Arc<T>)
pub fn provide<T: Send + Sync + 'static>(&mut self, service: Arc<T>)
Publish a service so other modules and the host layer can resolve it by type.
Registering the same type twice replaces the previous instance — the later module in the composition root wins, which is what an explicit override means.
pub fn service<T: Send + Sync + 'static>(&self) -> Option<Arc<T>>
Trait Implementations§
Source§impl Debug for ModuleRegistry
impl Debug for ModuleRegistry
Source§impl Default for ModuleRegistry
impl Default for ModuleRegistry
Source§fn default() -> ModuleRegistry
fn default() -> ModuleRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ModuleRegistry
impl !UnwindSafe for ModuleRegistry
impl Freeze for ModuleRegistry
impl Send for ModuleRegistry
impl Sync for ModuleRegistry
impl Unpin for ModuleRegistry
impl UnsafeUnpin for ModuleRegistry
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