pub struct ServiceRegistrar<'a> { /* private fields */ }Expand description
Owner-bound singleton registrar exposed by PluginContext.
The owner is created by PluginManager; plugins can register and retrieve typed values but
cannot select or spoof a registration owner.
Implementations§
Source§impl ServiceRegistrar<'_>
impl ServiceRegistrar<'_>
pub fn insert<T>(&mut self, value: Arc<T>) -> Result<(), ServiceError>
pub fn contains<T>(&self) -> bool
pub fn get<T>(&self) -> Result<Arc<T>, ServiceError>
pub fn get_optional<T>(&self) -> Result<Option<Arc<T>>, ServiceError>
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ServiceRegistrar<'a>
impl<'a> !UnwindSafe for ServiceRegistrar<'a>
impl<'a> Freeze for ServiceRegistrar<'a>
impl<'a> Send for ServiceRegistrar<'a>
impl<'a> Sync for ServiceRegistrar<'a>
impl<'a> Unpin for ServiceRegistrar<'a>
impl<'a> UnsafeUnpin for ServiceRegistrar<'a>
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