[][src]Struct llhd::table::SecondaryTable

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

A secondary table that associates additional information with entries in a primary table.

Implementations

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

pub fn new() -> Self[src]

Create a new empty table.

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

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

Add an entry to the table.

The user must provide the key with which the information is associated.

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

Remove an entry from the table.

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

Check whether an entry exists in the table.

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

Get an entry from the table, if one exists.

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

Get a mutable entry from the table, if one exists.

Trait Implementations

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

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

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

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

type Output = V

The returned type after indexing.

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

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

Auto Trait Implementations

impl<I, V> RefUnwindSafe for SecondaryTable<I, V> where
    I: RefUnwindSafe,
    V: RefUnwindSafe

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

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

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

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

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> 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.