Struct IndexMap

Source
pub struct IndexMap<I: Into<usize> + From<usize>, V> { /* private fields */ }
Expand description

Stores index based maps.

Implementations§

Source§

impl<I: Into<usize> + From<usize>, V> IndexMap<I, V>

Source

pub fn is_empty(&self) -> bool

Returns if the index map contains no elements.

Source

pub fn len(&self) -> usize

Returns the number of elements.

Source

pub fn get(&self, index: I) -> Option<&V>

Gets an entry by index.

Source

pub fn get_mut(&self, index: I) -> Option<&V>

Gets a mutable entry by index.

Source

pub fn iter(&self) -> Iter<'_, I, V>

Returns an iterator over the index map.

Trait Implementations§

Source§

impl<I: Into<usize> + From<usize>, V> Default for IndexMap<I, V>

Source§

fn default() -> Self

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

impl<I: Into<usize> + From<usize>, V> Index<I> for IndexMap<I, V>

Source§

type Output = V

The returned type after indexing.
Source§

fn index(&self, index: I) -> &V

Performs the indexing (container[index]) operation. Read more
Source§

impl<I: Into<usize> + From<usize>, V> IndexMut<I> for IndexMap<I, V>

Source§

fn index_mut(&mut self, index: I) -> &mut V

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<'a, I: Into<usize> + From<usize>, V> IntoIterator for &'a IndexMap<I, V>

Source§

type Item = (I, &'a V)

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, I, V>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Iter<'a, I, V>

Creates an iterator from a value. Read more
Source§

impl<I: Into<usize> + From<usize>, V> IntoIterator for IndexMap<I, V>

Source§

type Item = (I, V)

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<I, V>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> IntoIter<I, V>

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<I, V> Freeze for IndexMap<I, V>

§

impl<I, V> RefUnwindSafe for IndexMap<I, V>

§

impl<I, V> Send for IndexMap<I, V>
where I: Send, V: Send,

§

impl<I, V> Sync for IndexMap<I, V>
where I: Sync, V: Sync,

§

impl<I, V> Unpin for IndexMap<I, V>
where I: Unpin, V: Unpin,

§

impl<I, V> UnwindSafe for IndexMap<I, V>
where I: UnwindSafe, V: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.