pub struct HeterogeneousMap<Key, Value>(HashMap<Key, Value>);
Expand description
An heterogenous map is a map from Key
to Value
. It provide
the methods insert
and get
for any type T
that
implements SupportedType<Value>
.
Tuple Fields§
§0: HashMap<Key, Value>
Implementations§
source§impl<Key: Hash + Eq + PartialEq, Value> HeterogeneousMap<Key, Value>
impl<Key: Hash + Eq + PartialEq, Value> HeterogeneousMap<Key, Value>
pub(super) fn insert<T>(&mut self, key: Key, value: Arc<T>)where
T: SupportedType<Value>,
pub(super) fn insert_raw_value(&mut self, key: Key, value: Value)
pub(super) fn from_iter(it: impl Iterator<Item = (Key, Value)>) -> Self
pub(super) fn into_iter(self) -> impl Iterator<Item = (Key, Value)>
pub(super) fn get<T>(&self, key: &Key) -> Option<Option<Arc<T>>>where
T: SupportedType<Value>,
Trait Implementations§
source§impl<Key: Clone, Value: Clone> Clone for HeterogeneousMap<Key, Value>
impl<Key: Clone, Value: Clone> Clone for HeterogeneousMap<Key, Value>
source§fn clone(&self) -> HeterogeneousMap<Key, Value>
fn clone(&self) -> HeterogeneousMap<Key, Value>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<Key, Value> Freeze for HeterogeneousMap<Key, Value>
impl<Key, Value> RefUnwindSafe for HeterogeneousMap<Key, Value>where
Key: RefUnwindSafe,
Value: RefUnwindSafe,
impl<Key, Value> Send for HeterogeneousMap<Key, Value>
impl<Key, Value> Sync for HeterogeneousMap<Key, Value>
impl<Key, Value> Unpin for HeterogeneousMap<Key, Value>
impl<Key, Value> UnwindSafe for HeterogeneousMap<Key, Value>where
Key: UnwindSafe,
Value: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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