[][src]Struct llhd::table::PrimaryTable

pub struct PrimaryTable<I, V> { /* fields omitted */ }

A primary table that provides dense key-based storage.

Implementations

impl<I, V> PrimaryTable<I, V>[src]

pub fn new() -> Self[src]

Create a new primary table.

impl<I: TableKey, V> PrimaryTable<I, V>[src]

pub fn add(&mut self, value: V) -> I[src]

Add a new entry to the table.

Returns the key under which the entry can be accessed again.

pub fn remove(&mut self, key: I)[src]

Remove an entry from the table.

Panics if the entry does not exist.

pub fn iter<'a>(&'a self) -> impl Iterator<Item = (I, &'a V)> + 'a[src]

Return an iterator over the keys and values in the table.

pub fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = (I, &'a mut V)> + 'a[src]

Return an iterator over the keys and mutable values in the table.

pub fn keys<'a>(&'a self) -> impl Iterator<Item = I> + 'a[src]

Return an iterator over the keys in the table.

pub fn values<'a>(&'a self) -> impl Iterator<Item = &'a V> + 'a[src]

Return an iterator over the values in the table.

pub fn values_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut V> + 'a[src]

Return an iterator over the mutable values in the table.

Trait Implementations

impl<I: Clone, V: Clone> Clone for PrimaryTable<I, V>[src]

impl<I, V> Default for PrimaryTable<I, V>[src]

impl<'de, I, V> Deserialize<'de> for PrimaryTable<I, V> where
    V: Deserialize<'de>, 
[src]

impl<I: TableKey, V> Index<I> for PrimaryTable<I, V>[src]

type Output = V

The returned type after indexing.

impl<I: TableKey, V> IndexMut<I> for PrimaryTable<I, V>[src]

impl<I, V> Serialize for PrimaryTable<I, V> where
    V: Serialize
[src]

Auto Trait Implementations

impl<I, V> RefUnwindSafe for PrimaryTable<I, V> where
    I: RefUnwindSafe,
    V: RefUnwindSafe
[src]

impl<I, V> Send for PrimaryTable<I, V> where
    I: Send,
    V: Send
[src]

impl<I, V> Sync for PrimaryTable<I, V> where
    I: Sync,
    V: Sync
[src]

impl<I, V> Unpin for PrimaryTable<I, V> where
    I: Unpin,
    V: Unpin
[src]

impl<I, V> UnwindSafe for PrimaryTable<I, V> where
    I: UnwindSafe,
    V: UnwindSafe
[src]

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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.