[][src]Struct shine_graph::svec::Entry

pub struct Entry<'a, S> where
    S: StoreMut
{ /* fields omitted */ }

Entry to a slot in a sparse vector.

Methods

impl<'a, S> Entry<'a, S> where
    S: 'a + StoreMut
[src]

pub fn index(&self) -> usize[src]

pub fn get(&self) -> Option<&S::Item>[src]

Return the (immutable) non-zero data at the given slot. If data is zero, None is returned.

pub fn get_mut(&mut self) -> Option<&mut S::Item>[src]

Return the (mutable) non-zero data at the given slot. If data is zero, None is returned.

pub fn get_or(&mut self, item: S::Item) -> &mut S::Item[src]

Get the mutable non-zero data at the given slot or creates a new item if the entry is vacant.

pub fn get_or_new<F: FnOnce() -> S::Item>(&mut self, f: F) -> &mut S::Item[src]

Get the mutable non-zero data at the given slot or creates a new item if the entry is vacant.

pub fn remove(&mut self) -> Option<S::Item>[src]

impl<'a, I, S> Entry<'a, S> where
    I: Default,
    S: 'a + StoreMut<Item = I>, 
[src]

pub fn get_or_default(&mut self) -> &mut S::Item[src]

Get the mutable non-zero data at the given slot or creates a new item if the entry is vacant.

Trait Implementations

impl<'a, I, S> Debug for Entry<'a, S> where
    I: Debug,
    S: 'a + StoreMut<Item = I>, 
[src]

Auto Trait Implementations

impl<'a, S> !Send for Entry<'a, S>

impl<'a, S> !Sync for Entry<'a, S>

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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