pub struct TypeMap<M> {
data: HashMap<TypeId, Box<dyn TypeMappable>>,
phantom: PhantomData<M>,
}
Expand description
A map that maps types to values in a generic manner: we store for each type T
a value of
type M::Value<T>
.
Fields§
§data: HashMap<TypeId, Box<dyn TypeMappable>>
§phantom: PhantomData<M>
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<M> Freeze for TypeMap<M>
impl<M> !RefUnwindSafe for TypeMap<M>
impl<M> Send for TypeMap<M>where
M: Send,
impl<M> Sync for TypeMap<M>where
M: Sync,
impl<M> Unpin for TypeMap<M>where
M: Unpin,
impl<M> !UnwindSafe for TypeMap<M>
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more