Struct phf::Map

source ·
pub struct Map<K: 'static, V: 'static> { /* private fields */ }
Expand description

An immutable map constructed at compile time.

Note

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

Implementations§

Returns true if the Map is empty.

Returns the number of entries in the Map.

Determines if key is in the Map.

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.

source

pub fn get_entry<T>(&self, key: &T) -> Option<(&K, &V)>where
    T: Eq + PhfHash + ?Sized,
    K: Borrow<T>,

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 an arbitrary but fixed order.

Returns an iterator over the keys in the map.

Keys are returned in an arbitrary but fixed order.

Returns an iterator over the values in the map.

Values are returned in an arbitrary but fixed order.

Trait Implementations§

Formats the value using the given formatter. Read more
The returned type after indexing.
Performs the indexing (container[index]) operation. Read more
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

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.