pub struct Table { /* private fields */ }
Expand description
the table data container. Consists of named columns and metadata tags. See the module-level documentation for more details.
Implementations§
Source§impl Table
impl Table
Sourcepub fn set_col(&mut self, col_name: &str, col: Col)
pub fn set_col(&mut self, col_name: &str, col: Col)
adds column to the table and gives it a name, if specified. If a column with the same name already exists, it will be overridden.
Sourcepub fn get_col(&self, col_name: &str) -> Option<&Col>
pub fn get_col(&self, col_name: &str) -> Option<&Col>
returns reference to the column with the name col_name
if one exists,
None
otherwise.
Sourcepub fn get_col_mut(&mut self, col_name: &str) -> Option<&mut Col>
pub fn get_col_mut(&mut self, col_name: &str) -> Option<&mut Col>
returns mutable reference to the column with the name col_name
if one
exists, None
otherwise.
Sourcepub fn remove_col(&mut self, col_name: &str) -> Option<Col>
pub fn remove_col(&mut self, col_name: &str) -> Option<Col>
removes column with the name col_name
if one exists and returns it.
Returns None
if no column named col_name
exists.
Sourcepub fn data(self) -> Vec<(String, Col)>
pub fn data(self) -> Vec<(String, Col)>
returns vec of (column-name, column) pairs, discarding the metadata tags
Sourcepub fn data_unnamed(self) -> Vec<Col>
pub fn data_unnamed(self) -> Vec<Col>
returns vec of columns discarding column names and metadata tags
Trait Implementations§
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> 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