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,
impl<I> Table<I>where I: Hash + PartialEq + Eq,
sourcepub fn new(
schema: Arc<Schema>,
columns: Vec<Column>,
event_ids: HashMap<I, usize>
) -> Result<Self, &'static str>
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.
sourcepub fn append(&mut self, other: &mut Self)
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
.
sourcepub fn column(&self, i: usize) -> Option<&Column>
pub fn column(&self, i: usize) -> Option<&Column>
Returns an immutable reference of a specific column
sourcepub fn num_columns(&self) -> usize
pub fn num_columns(&self) -> usize
Returns the number of columns in the table.
sourcepub 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>
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.
sourcepub 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>
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.
pub fn event_index(&self, eventid: &I) -> Option<&usize>
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more