Struct structured::Table

source ·
pub struct Table<I> { /* private fields */ }
Expand description

Structured data represented in a column-oriented form.

Implementations§

source§

impl<I> Table<I>where I: Hash + PartialEq + Eq,

source

pub fn new( schema: Arc<Schema>, columns: Vec<Column>, event_ids: HashMap<I, usize> ) -> Result<Self, &'static str>

Creates a new Table with the given schema and columns.

Errors

Returns an error if columns have different lengths.

source

pub fn append(&mut self, other: &mut Self)

Moves all the rows of other intot self, leaving other empty.

Panics

Panics if the types of columns are different, or the number of rows overflows usize.

source

pub fn columns(&self) -> Iter<'_, Column>

Returns an Iterator for columns.

source

pub fn column(&self, i: usize) -> Option<&Column>

Returns an immutable reference of a specific column

source

pub fn num_columns(&self) -> usize

Returns the number of columns in the table.

source

pub fn num_rows(&self) -> usize

Returns the number of rows in the table.

source

pub fn schema(&self) -> &Arc<Schema>

Returns the schema of the table.

source

pub fn statistics( &self, rows: &[usize], column_types: &Arc<Vec<ColumnType>>, r_enum_maps: &HashMap<usize, HashMap<u64, Vec<String>>>, time_intervals: &Arc<Vec<u32>>, numbers_of_top_n: &Arc<Vec<u32>>, precision: i32 ) -> Vec<ColumnStatistics>

Panics

Panics if time intervals or number of top n is not defined.

source

pub fn count_group_by( &self, rows: &[usize], column_types: &Arc<Vec<ColumnType>>, by_column: usize, by_interval: Option<u32>, count_columns: &Arc<Vec<usize>> ) -> Vec<GroupCount>

Panics

Panics if columns are not defined.

source

pub fn event_index(&self, eventid: &I) -> Option<&usize>

Trait Implementations§

source§

impl<I: Clone> Clone for Table<I>

source§

fn clone(&self) -> Table<I>

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<I: Debug> Debug for Table<I>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<I> !RefUnwindSafe for Table<I>

§

impl<I> Send for Table<I>where I: Send,

§

impl<I> Sync for Table<I>where I: Sync,

§

impl<I> Unpin for Table<I>where I: Unpin,

§

impl<I> !UnwindSafe for Table<I>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere T: Clone,

§

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