Struct trait_map::TypedContext
source · pub struct TypedContext<'a, E: ?Sized> { /* private fields */ }
Expand description
Implementations§
source§impl<'a, Entry> TypedContext<'a, Entry>where
Entry: 'static,
impl<'a, Entry> TypedContext<'a, Entry>where
Entry: 'static,
sourcepub fn add_trait<Trait>(&mut self) -> &mut Selfwhere
Trait: ?Sized + Pointee<Metadata = DynMetadata<Trait>> + 'static,
Entry: Unsize<Trait>,
pub fn add_trait<Trait>(&mut self) -> &mut Selfwhere
Trait: ?Sized + Pointee<Metadata = DynMetadata<Trait>> + 'static,
Entry: Unsize<Trait>,
Register a trait to be saved into the type map
sourcepub fn remove_trait<Trait>(&mut self) -> &mut Selfwhere
Trait: ?Sized + Pointee<Metadata = DynMetadata<Trait>> + 'static,
Entry: Unsize<Trait>,
pub fn remove_trait<Trait>(&mut self) -> &mut Selfwhere
Trait: ?Sized + Pointee<Metadata = DynMetadata<Trait>> + 'static,
Entry: Unsize<Trait>,
Unregister a trait from the type map