Trait hooks_gen::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

Object Safety§

This trait is not object safe.

Implementors§

source§

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

§

type Value = T

§

type Owner = Owner<T>