Struct iron::TypeMap [] [src]

pub struct TypeMap<A = UnsafeAny + 'static> where
    A: UnsafeAnyExt + ?Sized
{ /* fields omitted */ }

A map keyed by types.

Can contain one value of any type for each key type, as defined by the Assoc trait.

You usually do not need to worry about the A type parameter, but it can be used to add bounds to the possible value types that can be stored in this map. Usually, you are looking for ShareMap, which is Send + Sync.

Methods

impl TypeMap<UnsafeAny + 'static>
[src]

[src]

Create a new, empty TypeMap.

impl<A> TypeMap<A> where
    A: UnsafeAnyExt + ?Sized
[src]

[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.

[src]

Insert a value into the map with a specified key type.

[src]

Find a value in the map and get a reference to it.

[src]

Find a value in the map and get a mutable reference to it.

[src]

Check if a key has an associated value stored in the map.

[src]

Remove a value from the map.

Returns true if a value was removed.

[src]

Get the given key's corresponding entry in the map for in-place manipulation.

[src]

Read the underlying HashMap

[src]

Get a mutable reference to the underlying HashMap

[src]

Get the number of values stored in the map.

[src]

Return true if the map contains no values.

[src]

Remove all entries from the map.

Trait Implementations

impl<A> Clone for TypeMap<A> where
    A: UnsafeAnyExt + ?Sized,
    Box<A>: Clone
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<A> Debug for TypeMap<A> where
    A: Debug + UnsafeAnyExt + ?Sized
[src]

[src]

Formats the value using the given formatter.

impl<A> Default for TypeMap<A> where
    A: Default + UnsafeAnyExt + ?Sized
[src]

[src]

Returns the "default value" for a type. Read more