Trait Key

Source
pub trait Key: Copy + PartialEq {
    type Value;
    type Owner: Owner<Key = Self>;

    // Required methods
    fn owner(self) -> Self::Owner;
    fn map<R>(self, f: impl FnOnce(&Self::Value) -> R) -> R;
    fn map_mut<R>(self, f: impl FnOnce(&mut Self::Value) -> R) -> R;
}

Required Associated Types§

Source

type Value

Source

type Owner: Owner<Key = Self>

Required Methods§

Source

fn owner(self) -> Self::Owner

Source

fn map<R>(self, f: impl FnOnce(&Self::Value) -> R) -> R

Source

fn map_mut<R>(self, f: impl FnOnce(&mut Self::Value) -> R) -> R

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: 'static> Key for Key<T>