Struct typedmap::hashmap::TypedKeyValue
source · pub struct TypedKeyValue<Marker, KB: 'static + Bounds, VB: 'static + Bounds> { /* private fields */ }
Expand description
Represents owned pair of key and value.
Implementations§
source§impl<Marker, KB, VB> TypedKeyValue<Marker, KB, VB>where
KB: 'static + Bounds,
VB: 'static + Bounds,
impl<Marker, KB, VB> TypedKeyValue<Marker, KB, VB>where KB: 'static + Bounds, VB: 'static + Bounds,
sourcepub fn downcast_key_ref<K: 'static + TypedMapKey<Marker>>(&self) -> Option<&K>where
KB: HasBounds<K>,
pub fn downcast_key_ref<K: 'static + TypedMapKey<Marker>>(&self) -> Option<&K>where KB: HasBounds<K>,
Downcast key to reference of K
. Returns None
if not possible.
sourcepub fn downcast_key<K: 'static + TypedMapKey<Marker>>(self) -> Result<K, Self>where
KB: HasBounds<K>,
pub fn downcast_key<K: 'static + TypedMapKey<Marker>>(self) -> Result<K, Self>where KB: HasBounds<K>,
Downcast key to the owned value of type K
. Returns Err(Self) if not possible.
sourcepub fn downcast_value_ref<V: 'static>(&self) -> Option<&V>where
VB: HasBounds<V>,
pub fn downcast_value_ref<V: 'static>(&self) -> Option<&V>where VB: HasBounds<V>,
Downcast key to reference of V
. Returns None
if not possible.
sourcepub fn downcast_value<V: 'static>(self) -> Result<V, Self>where
VB: HasBounds<V>,
pub fn downcast_value<V: 'static>(self) -> Result<V, Self>where VB: HasBounds<V>,
Downcast key to the owned value of type V
. Returns Err(Self) if not possible.
sourcepub fn downcast_pair_ref<K>(&self) -> Option<(&K, &K::Value)>where
K: 'static + TypedMapKey<Marker>,
KB: HasBounds<K>,
VB: HasBounds<K::Value>,
pub fn downcast_pair_ref<K>(&self) -> Option<(&K, &K::Value)>where K: 'static + TypedMapKey<Marker>, KB: HasBounds<K>, VB: HasBounds<K::Value>,
Downcast key to reference of K
and value to reference of K::Value
.
Returns None
if not possible.
sourcepub fn downcast_pair<K>(self) -> Result<(K, K::Value), Self>where
K: 'static + TypedMapKey<Marker>,
KB: HasBounds<K>,
VB: HasBounds<K::Value>,
pub fn downcast_pair<K>(self) -> Result<(K, K::Value), Self>where K: 'static + TypedMapKey<Marker>, KB: HasBounds<K>, VB: HasBounds<K::Value>,
Downcast key to owned value of type K
and value to owned value of type K::Value
.
Returns Err(Self) if not possible.
pub fn key_container_ref(&self) -> &KB::Container
pub fn key_container_mut(&mut self) -> &mut KB::Container
pub fn value_container_ref(&self) -> &VB::Container
pub fn value_container_mut(&mut self) -> &mut VB::Container
pub fn into_key_container(self) -> Box<KB::Container>
pub fn into_value_container(self) -> Box<VB::Container>
pub fn into_container_pair(self) -> (Box<KB::Container>, Box<VB::Container>)
Trait Implementations§
Auto Trait Implementations§
impl<Marker, KB, VB> RefUnwindSafe for TypedKeyValue<Marker, KB, VB>where Marker: RefUnwindSafe, <VB as Bounds>::Container: RefUnwindSafe, <KB as Bounds>::KeyContainer: RefUnwindSafe,
impl<Marker, KB, VB> Send for TypedKeyValue<Marker, KB, VB>where Marker: Send, <VB as Bounds>::Container: Send, <KB as Bounds>::KeyContainer: Send,
impl<Marker, KB, VB> Sync for TypedKeyValue<Marker, KB, VB>where Marker: Sync, <VB as Bounds>::Container: Sync, <KB as Bounds>::KeyContainer: Sync,
impl<Marker, KB, VB> Unpin for TypedKeyValue<Marker, KB, VB>where Marker: Unpin,
impl<Marker, KB, VB> UnwindSafe for TypedKeyValue<Marker, KB, VB>where Marker: UnwindSafe, <VB as Bounds>::Container: UnwindSafe, <KB as Bounds>::KeyContainer: 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