Struct shio::util::typemap::TypeMap
[−]
[src]
pub struct TypeMap<A: ?Sized = UnsafeAny> where
A: UnsafeAnyExt, { /* fields omitted */ }
Methods
impl TypeMap
[src]
impl<A: UnsafeAnyExt + ?Sized> TypeMap<A>
[src]
fn custom() -> TypeMap<A>
[src]
Create a new, empty TypeMap.
Can be used with any A
parameter; new
is specialized to get around
the required type annotations when using this function.
fn put<K: Key>(&mut self, val: K::Value) -> Option<K::Value> where
K::Value: Any + Implements<A>,
[src]
K::Value: Any + Implements<A>,
Insert a value into the map with a specified key type.
fn get<K: Key>(&self) -> &K::Value where
K::Value: Any + Implements<A>,
[src]
K::Value: Any + Implements<A>,
fn try_get<K: Key>(&self) -> Option<&K::Value> where
K::Value: Any + Implements<A>,
[src]
K::Value: Any + Implements<A>,
Attempt to get a value from the type map.
fn has<K: Key>(&self) -> bool
[src]
Check if a key has an associated value stored in the map.
Trait Implementations
impl<A: Default + ?Sized> Default for TypeMap<A> where
A: UnsafeAnyExt,
[src]
A: UnsafeAnyExt,
impl<A: Debug + ?Sized> Debug for TypeMap<A> where
A: UnsafeAnyExt,
[src]
A: UnsafeAnyExt,