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,

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

pub fn key_container_ref(&self) -> &KB::Container

source

pub fn key_container_mut(&mut self) -> &mut KB::Container

source

pub fn value_container_ref(&self) -> &VB::Container

source

pub fn value_container_mut(&mut self) -> &mut VB::Container

source

pub fn into_key_container(self) -> Box<KB::Container>

source

pub fn into_value_container(self) -> Box<VB::Container>

source

pub fn into_container_pair(self) -> (Box<KB::Container>, Box<VB::Container>)

Trait Implementations§

source§

impl<M, KB: 'static + Bounds, VB: 'static + Bounds> Debug for TypedKeyValue<M, KB, VB>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.