pub struct AnyMap { /* private fields */ }Expand description
A thread-safe type-erased map — one value per type.
Implementations§
Source§impl AnyMap
impl AnyMap
Sourcepub fn insert<T: Send + Sync + 'static>(&mut self, value: T)
pub fn insert<T: Send + Sync + 'static>(&mut self, value: T)
Inserts a value, replacing any existing value of the same type.
Sourcepub fn get<T: Send + Sync + 'static>(&self) -> Option<Arc<T>>
pub fn get<T: Send + Sync + 'static>(&self) -> Option<Arc<T>>
Returns a cloned Arc reference to the value of the given type, if present.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AnyMap
impl !RefUnwindSafe for AnyMap
impl Send for AnyMap
impl Sync for AnyMap
impl Unpin for AnyMap
impl UnsafeUnpin for AnyMap
impl !UnwindSafe for AnyMap
Blanket Implementations§
Source§impl<T> AppLifecycle for Twhere
T: ?Sized,
impl<T> AppLifecycle for Twhere
T: ?Sized,
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