Struct phf::OrderedMap [] [src]

pub struct OrderedMap<K: 'static, V: 'static> { /* fields omitted */ }

An order-preserving immutable map constructed at compile time.

Unlike a Map, iteration order is guaranteed to match the definition order.

Note

The fields of this struct are public so that they may be initialized by the phf_ordered_map! macro and code generation. They are subject to change at any time and should never be accessed directly.

Methods

impl<K, V> OrderedMap<K, V>
[src]

Returns the number of entries in the Map.

Returns true if the Map is empty.

Returns a reference to the value that key maps to.

Returns a reference to the map's internal static instance of the given key.

This can be useful for interning schemes.

Determines if key is in the Map.

Returns the index of the key within the list used to initialize the ordered map.

Returns references to both the key and values at an index within the list used to initialize the ordered map. See .get_index(key).

Like get, but returns both the key and the value.

Returns an iterator over the key/value pairs in the map.

Entries are returned in the same order in which they were defined.

Returns an iterator over the keys in the map.

Keys are returned in the same order in which they were defined.

Returns an iterator over the values in the map.

Values are returned in the same order in which they were defined.

Trait Implementations

impl<K, V> Debug for OrderedMap<K, V> where K: Debug, V: Debug
[src]

Formats the value using the given formatter.

impl<'a, K, V, T: ?Sized> Index<&'a T> for OrderedMap<K, V> where T: Eq + PhfHash, K: Borrow<T>
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl<'a, K, V> IntoIterator for &'a OrderedMap<K, V>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more