Struct Table

Source
pub struct Table<C: TableKV, R: TableKV, V: TableKV> {
    pub tuples: HashMap<(usize, usize), HashSet<usize>>,
    pub cols2values: HashMap<usize, HashSet<usize>>,
    pub rows2values: HashMap<usize, HashSet<usize>>,
    pub values: HashMap<usize, V>,
    pub cols: HashMap<usize, C>,
    pub rows: HashMap<usize, R>,
}

Fields§

§tuples: HashMap<(usize, usize), HashSet<usize>>§cols2values: HashMap<usize, HashSet<usize>>§rows2values: HashMap<usize, HashSet<usize>>§values: HashMap<usize, V>§cols: HashMap<usize, C>§rows: HashMap<usize, R>

Implementations§

Source§

impl<C: TableKV, R: TableKV, V: TableKV> Table<C, R, V>

Source

pub fn new() -> Self

Source

pub fn insert(&mut self, column: C, row: R, value: V)

Source

pub fn insert_column_value(&mut self, column: C, row_key: usize, value: V)

Source

pub fn insert_row_value(&mut self, column_key: usize, row: R, value: V)

Source

pub fn insert_value(&mut self, column_key: usize, row_key: usize, value: V)

Source

pub fn remove(&mut self, column_key: usize, row_key: usize, value_key: usize)

Source

pub fn remove_by_row(&mut self, row_key_to_remove: usize)

Source

pub fn remove_by_column(&mut self, column_key_to_remove: usize)

Source

pub fn is_empty(&self) -> bool

Trait Implementations§

Source§

impl<C: Clone + TableKV, R: Clone + TableKV, V: Clone + TableKV> Clone for Table<C, R, V>

Source§

fn clone(&self) -> Table<C, R, V>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<C: Debug + TableKV, R: Debug + TableKV, V: Debug + TableKV> Debug for Table<C, R, V>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<C, R, V> Freeze for Table<C, R, V>

§

impl<C, R, V> RefUnwindSafe for Table<C, R, V>

§

impl<C, R, V> Send for Table<C, R, V>
where V: Send, C: Send, R: Send,

§

impl<C, R, V> Sync for Table<C, R, V>
where V: Sync, C: Sync, R: Sync,

§

impl<C, R, V> Unpin for Table<C, R, V>
where V: Unpin, C: Unpin, R: Unpin,

§

impl<C, R, V> UnwindSafe for Table<C, R, V>
where V: UnwindSafe, C: UnwindSafe, R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.