pub struct Map(/* private fields */);
Expand description
A type map to store values by type.
Implementations§
source§impl Map
impl Map
sourcepub fn insert<T: Send + Sync + 'static>(&mut self, value: T) -> Option<T>
pub fn insert<T: Send + Sync + 'static>(&mut self, value: T) -> Option<T>
Insert a type into the Context
.
sourcepub fn remove<T: Send + Sync + 'static>(&mut self) -> Option<T>
pub fn remove<T: Send + Sync + 'static>(&mut self) -> Option<T>
Remove a type from the Context
.
sourcepub fn get<T: Send + Sync + 'static>(&self) -> Option<&T>
pub fn get<T: Send + Sync + 'static>(&self) -> Option<&T>
Get a reference to a type from the Context
.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Map
impl Send for Map
impl Sync for Map
impl Unpin for Map
impl !UnwindSafe for Map
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