pub enum ColumnData {
Strings(Vec<String>),
Numeric(Vec<f64>),
Categorical {
codes: Vec<i32>,
categories: Vec<String>,
},
}Expand description
A metadata column with typed data.
Supports string, numeric, and categorical columns as found in .h5ad files.
Variants§
Strings(Vec<String>)
Free-text string values.
Numeric(Vec<f64>)
Numeric (f64) values.
Categorical
Categorical data stored as integer codes indexing into a category list.
Implementations§
Source§impl ColumnData
impl ColumnData
Sourcepub fn as_strings(&self) -> Option<&Vec<String>>
pub fn as_strings(&self) -> Option<&Vec<String>>
Try to get as string slice. Returns None if not Strings variant.
Sourcepub fn as_numeric(&self) -> Option<&Vec<f64>>
pub fn as_numeric(&self) -> Option<&Vec<f64>>
Try to get as numeric slice. Returns None if not Numeric variant.
Trait Implementations§
Source§impl Clone for ColumnData
impl Clone for ColumnData
Source§fn clone(&self) -> ColumnData
fn clone(&self) -> ColumnData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ColumnData
impl Debug for ColumnData
Source§impl PartialEq for ColumnData
impl PartialEq for ColumnData
impl StructuralPartialEq for ColumnData
Auto Trait Implementations§
impl Freeze for ColumnData
impl RefUnwindSafe for ColumnData
impl Send for ColumnData
impl Sync for ColumnData
impl Unpin for ColumnData
impl UnsafeUnpin for ColumnData
impl UnwindSafe for ColumnData
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