Struct rs_graph::collections::ItemVecMap[][src]

pub struct ItemVecMap<'a, I, V> { /* fields omitted */ }

A thin wrapper around a ItemVec<_, Option<V>>.

Such a vector can be used as ItemMap<_, V> with a field being None if and only if the corresponding key is not contained in the map.

Implementations

impl<'a, I, V> ItemVecMap<'a, I, V> where
    I: Indexer
[src]

pub fn new_empty(vec: &'a mut ItemVec<I, Option<V>>) -> Self[src]

Trait Implementations

impl<'a, I, V> ItemMap<<I as Indexer>::Idx, V> for ItemVecMap<'a, I, V> where
    I: Indexer,
    I::Idx: Copy
[src]

fn is_empty(&self) -> bool[src]

Return true if this map is empty.

fn len(&self) -> usize[src]

Return the number of items in this map.

fn clear(&mut self)[src]

Remove all items from the map.

fn insert(&mut self, key: I::Idx, value: V) -> bool[src]

Add one item to the map. Read more

fn insert_or_replace(&mut self, key: I::Idx, value: V) -> bool[src]

Add one item to the map. Read more

fn remove(&mut self, key: I::Idx) -> bool[src]

Remove one item from the map. Read more

fn get(&self, key: I::Idx) -> Option<&V>[src]

Return a read-only reference to the element with the given key.

fn get_mut(&mut self, key: I::Idx) -> Option<&mut V>[src]

Return a mutable reference to the element with the given key.

fn contains(&self, key: I::Idx) -> bool[src]

Return true iff item u is contained in this map.

Auto Trait Implementations

impl<'a, I, V> RefUnwindSafe for ItemVecMap<'a, I, V> where
    I: RefUnwindSafe,
    V: RefUnwindSafe

impl<'a, I, V> Send for ItemVecMap<'a, I, V> where
    I: Send,
    V: Send

impl<'a, I, V> Sync for ItemVecMap<'a, I, V> where
    I: Sync,
    V: Sync

impl<'a, I, V> Unpin for ItemVecMap<'a, I, V>

impl<'a, I, V> !UnwindSafe for ItemVecMap<'a, I, V>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.