[−][src]Struct shine_graph::svec::Entry
Entry to a slot in a sparse vector.
Methods
impl<'a, S> Entry<'a, S> where
S: 'a + StoreMut,
[src]
S: 'a + StoreMut,
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]
I: Default,
S: 'a + StoreMut<Item = I>,
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
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,