[−][src]Struct phf::Map
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.
Methods
impl<K, V> Map<K, V>
[src]
impl<K, V> Map<K, V>
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
Returns true if the Map
is empty.
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
Returns the number of entries in the Map
.
pub fn contains_key<T: ?Sized>(&self, key: &T) -> bool where
T: Eq + PhfHash,
K: Borrow<T>,
[src]
pub fn contains_key<T: ?Sized>(&self, key: &T) -> bool where
T: Eq + PhfHash,
K: Borrow<T>,
Determines if key
is in the Map
.
pub fn get<T: ?Sized>(&self, key: &T) -> Option<&V> where
T: Eq + PhfHash,
K: Borrow<T>,
[src]
pub fn get<T: ?Sized>(&self, key: &T) -> Option<&V> where
T: Eq + PhfHash,
K: Borrow<T>,
Returns a reference to the value that key
maps to.
pub fn get_key<T: ?Sized>(&self, key: &T) -> Option<&K> where
T: Eq + PhfHash,
K: Borrow<T>,
[src]
pub fn get_key<T: ?Sized>(&self, key: &T) -> Option<&K> where
T: Eq + PhfHash,
K: Borrow<T>,
Returns a reference to the map's internal static instance of the given key.
This can be useful for interning schemes.
pub fn get_entry<T: ?Sized>(&self, key: &T) -> Option<(&K, &V)> where
T: Eq + PhfHash,
K: Borrow<T>,
[src]
pub fn get_entry<T: ?Sized>(&self, key: &T) -> Option<(&K, &V)> where
T: Eq + PhfHash,
K: Borrow<T>,
Like get
, but returns both the key and the value.
ⓘImportant traits for Entries<'a, K, V>pub fn entries<'a>(&'a self) -> Entries<'a, K, V>
[src]
pub fn entries<'a>(&'a self) -> Entries<'a, K, V>
Returns an iterator over the key/value pairs in the map.
Entries are returned in an arbitrary but fixed order.
ⓘImportant traits for Keys<'a, K, V>pub fn keys<'a>(&'a self) -> Keys<'a, K, V>
[src]
pub fn keys<'a>(&'a self) -> Keys<'a, K, V>
Returns an iterator over the keys in the map.
Keys are returned in an arbitrary but fixed order.
ⓘImportant traits for Values<'a, K, V>pub fn values<'a>(&'a self) -> Values<'a, K, V>
[src]
pub fn values<'a>(&'a self) -> Values<'a, K, V>
Returns an iterator over the values in the map.
Values are returned in an arbitrary but fixed order.
Trait Implementations
impl<'a, K, V> IntoIterator for &'a Map<K, V>
[src]
impl<'a, K, V> IntoIterator for &'a Map<K, V>
type Item = (&'a K, &'a V)
The type of the elements being iterated over.
type IntoIter = Entries<'a, K, V>
Which kind of iterator are we turning this into?
ⓘImportant traits for Entries<'a, K, V>fn into_iter(self) -> Entries<'a, K, V>
[src]
fn into_iter(self) -> Entries<'a, K, V>
Creates an iterator from a value. Read more
impl<K, V> Debug for Map<K, V> where
K: Debug,
V: Debug,
[src]
impl<K, V> Debug for Map<K, V> where
K: Debug,
V: Debug,
fn fmt(&self, fmt: &mut Formatter) -> Result
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'a, K, V, T: ?Sized> Index<&'a T> for Map<K, V> where
T: Eq + PhfHash,
K: Borrow<T>,
[src]
impl<'a, K, V, T: ?Sized> Index<&'a T> for Map<K, V> where
T: Eq + PhfHash,
K: Borrow<T>,
Auto Trait Implementations
impl<K, V> Send for Map<K, V> where
K: Send + Sync,
V: Send + Sync,
impl<K, V> Send for Map<K, V> where
K: Send + Sync,
V: Send + Sync,
impl<K, V> Sync for Map<K, V> where
K: Sync,
V: Sync,
impl<K, V> Sync for Map<K, V> where
K: Sync,
V: Sync,
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more