Struct typedmap::hashmap::TypedKeyValue [−][src]
Represents owned pair of key and value.
Implementations
impl<Marker> TypedKeyValue<Marker>
[src]
pub fn downcast_key_ref<K: 'static + TypedMapKey<Marker>>(&self) -> Option<&K>
[src]
Downcast key to reference of K
. Returns None
if not possible.
pub fn downcast_key<K: 'static + TypedMapKey<Marker>>(self) -> Result<K, Self>
[src]
Downcast key to the owned value of type K
. Returns Err(Self) if not possible.
pub fn downcast_value_ref<V: Any>(&self) -> Option<&V>
[src]
Downcast key to reference of V
. Returns None
if not possible.
pub fn downcast_value<V: Any>(self) -> Result<V, Self>
[src]
Downcast key to the owned value of type V
. Returns Err(Self) if not possible.
pub fn downcast_pair_ref<K: 'static + TypedMapKey<Marker>>(
&self
) -> Option<(&K, &K::Value)>
[src]
&self
) -> Option<(&K, &K::Value)>
Downcast key to reference of K
and value to reference of K::Value
.
Returns None
if not possible.
pub fn downcast_pair<K: 'static + TypedMapKey<Marker>>(
self
) -> Result<(K, K::Value), Self>
[src]
self
) -> Result<(K, K::Value), Self>
Downcast key to owned value of type K
and value to owned value of type K::Value
.
Returns Err(Self) if not possible.
Trait Implementations
Auto Trait Implementations
impl<Marker> !RefUnwindSafe for TypedKeyValue<Marker>
impl<Marker> !Send for TypedKeyValue<Marker>
impl<Marker> !Sync for TypedKeyValue<Marker>
impl<Marker> !Unpin for TypedKeyValue<Marker>
impl<Marker> !UnwindSafe for TypedKeyValue<Marker>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,