Trait trait_bound_typemap::TypeMap
source · [−]pub trait TypeMap {
type Key: MapKey<Map = Self>;
fn new() -> Self;
fn insert<T: TypedKeyTrait<Self::Key>>(&mut self, value: T::Value);
fn get<T: TypedKeyTrait<Self::Key>>(&self) -> Option<&T::Value>;
fn get_mut<T: TypedKeyTrait<Self::Key>>(&mut self) -> Option<&mut T::Value>;
fn remove<T: TypedKeyTrait<Self::Key>>(&mut self) -> Option<T::Value>;
fn contains_key<T: TypedKeyTrait<Self::Key>>(&self) -> bool;
}
Expand description
A trait implemented by all typemaps that provides all basic typemap functions
Associated Types
Required methods
Inserts a value into the typemap with the given key
Returns a reference to a value from the type map with the given provided key
Returns a mutable reference to a value from the type map with the given provided key
Removes a value from the map for the given key
fn contains_key<T: TypedKeyTrait<Self::Key>>(&self) -> bool
fn contains_key<T: TypedKeyTrait<Self::Key>>(&self) -> bool
Returns if the map contains a given key