Struct rustronomy_core::universal_containers::table::Table
source · [−]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
sourceimpl 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
sourceimpl<T> MetaDataContainer<T> for Table where
T: Display + Sized + Send + Sync + FromStr,
<T as FromStr>::Err: Debug,
impl<T> MetaDataContainer<T> for Table where
T: Display + Sized + Send + Sync + FromStr,
<T as FromStr>::Err: Debug,
sourcefn set_generic_tag(
&mut self,
tag: GenericMetaDataTag<T>
) -> Result<(), MetaDataErr>
fn set_generic_tag(
&mut self,
tag: GenericMetaDataTag<T>
) -> Result<(), MetaDataErr>
adds a generic metadata tag to a data container. Returns an error if the supplied tag is reserved. If the tag already exists, the old value will be overridden. Read more
sourcefn get_tag(&self, key: &str) -> Option<GenericMetaDataTag<T>>
fn get_tag(&self, key: &str) -> Option<GenericMetaDataTag<T>>
returns a copy of the tag associated with the supplied key, if it exists. reserved tags cannot be changed manually, but can be copied without any issues. Therefore, you may supply a restricted key to this function. Read more
sourcefn remove_generic_tag(
&mut self,
key: &str
) -> Result<GenericMetaDataTag<T>, MetaDataErr>
fn remove_generic_tag(
&mut self,
key: &str
) -> Result<GenericMetaDataTag<T>, MetaDataErr>
removes a generic metadata tag from a data container. Returns an error if the supplied tag is reserved or if the tag does not exist. Read more
Auto Trait Implementations
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnwindSafe for Table
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more