pub struct ModuleRef { /* private fields */ }Expand description
Runtime provider container. This is Boot’s Rust equivalent of Nest’s ModuleRef.
Implementations§
Source§impl ModuleRef
impl ModuleRef
pub fn new() -> Self
pub fn register(&self, definition: ProviderDefinition) -> Result<()>
pub fn insert<T>(&self, value: T) -> Result<()>
pub fn insert_arc<T>(&self, value: Arc<T>) -> Result<()>
pub fn get<T>(&self) -> Result<Arc<T>>
pub fn get_named<T>(&self, token: &str) -> Result<Arc<T>>
pub fn get_optional<T>(&self) -> Result<Option<Arc<T>>>
pub fn get_optional_named<T>(&self, token: &str) -> Result<Option<Arc<T>>>
pub fn contains(&self, token: &ProviderToken) -> Result<bool>
pub fn contains_provider<T>(&self) -> Result<bool>
pub fn contains_named(&self, token: &str) -> Result<bool>
pub fn tokens(&self) -> Result<Vec<ProviderToken>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModuleRef
impl RefUnwindSafe for ModuleRef
impl Send for ModuleRef
impl Sync for ModuleRef
impl Unpin for ModuleRef
impl UnsafeUnpin for ModuleRef
impl UnwindSafe for ModuleRef
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