Struct mech_core::Table

source ·
pub struct Table {
    pub id: u64,
    pub dynamic: bool,
    pub rows: usize,
    pub cols: usize,
    pub col_kinds: Vec<ValueKind>,
    pub col_map: AliasMap,
    pub row_map: AliasMap,
    pub data: Vec<Column>,
    pub nalgebra: Option<Rc<RefCell<DMatrix<f32>>>>,
    pub dictionary: StringDictionary,
}

Fields§

§id: u64§dynamic: bool§rows: usize§cols: usize§col_kinds: Vec<ValueKind>§col_map: AliasMap§row_map: AliasMap§data: Vec<Column>§nalgebra: Option<Rc<RefCell<DMatrix<f32>>>>§dictionary: StringDictionary

Implementations§

source§

impl Table

source

pub fn new(id: u64, rows: usize, cols: usize) -> Table

source

pub fn resize(&mut self, rows: usize, cols: usize) -> Result<(), MechError>

source

pub fn is_empty(&self) -> bool

source

pub fn get_col_raw(&self, col_ix: usize) -> Result<Column, MechError>

source

pub fn kind(&self) -> ValueKind

source

pub fn name(&self) -> Option<String>

source

pub fn get_column(&self, col: &TableIndex) -> Result<Column, MechError>

source

pub fn set_col_alias(&mut self, ix: usize, alias: u64) -> Result<(), MechError>

source

pub fn set_kind(&mut self, kind: ValueKind) -> Result<(), MechError>

source

pub fn extend(&mut self, other: &Table) -> Result<(), MechError>

source

pub fn set_col_kind( &mut self, col: usize, kind: ValueKind, ) -> Result<(), MechError>

source

pub fn get_by_index( &self, row: TableIndex, col: TableIndex, ) -> Result<Value, MechError>

source

pub fn set_col( &mut self, col_ix: usize, column: Column, ) -> Result<(), MechError>

source

pub fn get_columns(&self, col: &TableIndex) -> Result<Vec<Column>, MechError>

source

pub fn set( &self, row: &TableIndex, col: &TableIndex, val: Value, ) -> Result<(), MechError>

source

pub fn set_raw( &self, row: usize, col: usize, val: Value, ) -> Result<(), MechError>

source

pub fn get( &self, row: &TableIndex, col: &TableIndex, ) -> Result<Value, MechError>

source

pub fn get_raw(&self, row: usize, col: usize) -> Result<Value, MechError>

source

pub fn get_linear_raw(&self, ix: usize) -> Result<Value, MechError>

source

pub fn get_linear(&self, ix: usize) -> Result<Value, MechError>

source

pub fn len(&self) -> usize

source

pub fn get_column_unchecked(&self, col: usize) -> Column

source

pub fn has_col_aliases(&self) -> bool

source

pub fn subscript_to_index( &self, row: usize, col: usize, ) -> Result<usize, MechError>

source

pub fn index_to_subscript(&self, ix: usize) -> Result<(usize, usize), MechError>

source

pub fn set_linear(&self, ix: usize, val: Value) -> Result<(), MechError>

source

pub fn shape(&self) -> TableShape

source

pub fn logical_len(&self) -> usize

source

pub fn to_changes(&self) -> Vec<Change>

source

pub fn data_to_changes(&self) -> Vec<Change>

source

pub fn collect_columns_u8(&self) -> Vec<ColumnV<U8>>

source

pub fn collect_columns_u16(&self) -> Vec<ColumnV<U16>>

source

pub fn collect_columns_u32(&self) -> Vec<ColumnV<U32>>

source

pub fn collect_columns_u64(&self) -> Vec<ColumnV<U64>>

source

pub fn collect_columns_u128(&self) -> Vec<ColumnV<U128>>

source

pub fn collect_columns_i8(&self) -> Vec<ColumnV<I8>>

source

pub fn collect_columns_i16(&self) -> Vec<ColumnV<I16>>

source

pub fn collect_columns_i32(&self) -> Vec<ColumnV<I32>>

source

pub fn collect_columns_i64(&self) -> Vec<ColumnV<I64>>

source

pub fn collect_columns_i128(&self) -> Vec<ColumnV<I128>>

source

pub fn collect_columns_f32(&self) -> Vec<ColumnV<F32>>

source

pub fn collect_columns_f64(&self) -> Vec<ColumnV<F64>>

Trait Implementations§

source§

impl Debug for Table

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Table

§

impl !RefUnwindSafe for Table

§

impl !Send for Table

§

impl !Sync for Table

§

impl Unpin for Table

§

impl !UnwindSafe for Table

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> 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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

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

§

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

§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V