Struct rustc_data_structures::vec_map::VecMap[][src]

pub struct VecMap<K, V>(Vec<(K, V)>);
Expand description

A map type implemented as a vector of pairs K (key) and V (value). It currently provides a subset of all the map operations, the rest could be added as needed.

Tuple Fields

0: Vec<(K, V)>

Implementations

Sets the value of the entry, and returns the entry’s old value.

Gets a reference to the value in the entry.

Returns the any value corresponding to the supplied predicate filter.

The supplied predicate will be applied to each (key, value) pair and it will return a reference to the values where the predicate returns true.

Returns the value corresponding to the supplied predicate filter. It crashes if there’s more than one matching element.

The supplied predicate will be applied to each (key, value) pair and it will return a reference to the value where the predicate returns true.

Returns true if the map contains a value for the specified key.

The key may be any borrowed form of the map’s key type, Eq on the borrowed form must match those for the key type.

Returns true if the map contains no elements.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

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

🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

Performs the conversion.

Creates a value from an iterator. Read more

Performs the conversion.

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

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

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

Layout

Note: Most layout information is completely unstable and may be different between compiler versions and platforms. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 24 bytes