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

Methods

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, V> Default for SecondaryTable<I, V>[src]

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

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

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]

Auto Trait Implementations

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

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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]