Struct non_empty_collections::index_map::NonEmptyIndexMap[][src]

pub struct NonEmptyIndexMap<K, V, S = RandomState> { /* fields omitted */ }

A wrapper around ::indexmap::IndexMap that is guaranteed to have at least one element by the Rust's type system: it consists of a first element and an indexed map (which could be empty) rest elements.

Methods

impl<K, V> NonEmptyIndexMap<K, V, RandomState>
[src]

Creates a map with a default hasher.

Creates a map with a given capacity.

Creates a map from an item (a key and a value pair) standart hash map.

Creates a map from a given iterator with a default hasher.

impl<K, V, S> NonEmptyIndexMap<K, V, S> where
    K: Eq + Hash,
    S: BuildHasher
[src]

Creates a map with a given hasher.

Creates a map with a given capacity and a given hasher.

Iterates over key-value pairs of the map in an immutable way.

Iterates over key-value pairs of the map in a mutable way.

Creates a map from a given iterator with a given hasher.

Gets a value associated with a given key, if any.

Checks whether a given key exists in the map.

Gets a value associated with a given key, if any.

Removes and returns an element associated with a given key, if any.

An attempt to remove the last element will cause an Error to be returned.

Removes and element associated with a given key and return its value, if any.

An attempt to remove the last element will cause an Error to be returned.

Inserts a key-value pair into the map. If the map have already had an element associated with a given key, the associated value is updated and the old one is returned.

Returns the number of elements in the map.

Returns an entry that corresponds to a given key.

Gets an immutable reference to the firs element (only the value).

Gets a mutable reference to the firs element (only the value).

Gets an immutable reference to the rest indexed map of elements.

Gets a mutable reference to the rest indexed map of elements.

Trait Implementations

impl<'de, K, V, S> Deserialize<'de> for NonEmptyIndexMap<K, V, S> where
    K: Deserialize<'de>,
    V: Deserialize<'de>,
    K: Eq + Hash,
    S: BuildHasher + Default
[src]

Deserialize this value from the given Serde deserializer. Read more

impl<K, V, H> Serialize for NonEmptyIndexMap<K, V, H> where
    K: Serialize,
    V: Serialize,
    K: Eq + Hash,
    H: BuildHasher
[src]

Serialize this value into the given Serde serializer. Read more

impl<K: Clone, V: Clone, S: Clone> Clone for NonEmptyIndexMap<K, V, S>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<K: Eq + Hash, V, S: BuildHasher> Into<IndexMap<K, V, S>> for NonEmptyIndexMap<K, V, S>
[src]

Performs the conversion.

impl<K, V, S> Debug for NonEmptyIndexMap<K, V, S> where
    K: Eq + Hash + Debug,
    V: Debug,
    S: BuildHasher
[src]

Formats the value using the given formatter. Read more

impl<K, V, S> Extend<(K, V)> for NonEmptyIndexMap<K, V, S> where
    K: Eq + Hash,
    S: BuildHasher
[src]

Extends a collection with the contents of an iterator. Read more

impl<K, V, S> IntoIterator for NonEmptyIndexMap<K, V, S> where
    K: Eq + Hash,
    S: BuildHasher
[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

Auto Trait Implementations

impl<K, V, S> Send for NonEmptyIndexMap<K, V, S> where
    K: Send,
    S: Send,
    V: Send

impl<K, V, S> Sync for NonEmptyIndexMap<K, V, S> where
    K: Sync,
    S: Sync,
    V: Sync