Type Alias AnyMap

Source
pub type AnyMap = Map<dyn Any>;
Expand description

The most common type of Map: just using Any; [Map]<dyn [Any]>.

Why is this a separate type alias rather than a default value for Map<A>? Map::new() doesn’t seem to be happy to infer that it should go with the default value. It’s a bit sad, really. Ah well, I guess this approach will do.

Aliased Type§

struct AnyMap { /* private fields */ }

Implementations

Source§

impl<A: ?Sized + Downcast> Map<A>

Source

pub fn get<T: IntoBox<A>>(&self) -> Option<&T>

Returns a reference to the value stored in the collection for the type T, if it exists.

Source

pub fn entry<T: IntoBox<A>>(&mut self) -> Entry<'_, A, T>

Gets the entry for the given type in the collection for in-place manipulation

Trait Implementations

Source§

impl<A: Debug + ?Sized + Downcast> Debug for Map<A>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<A: ?Sized + Downcast> Default for Map<A>

Source§

fn default() -> Map<A>

Returns the “default value” for a type. Read more