Struct agnes::store::DataStore
[−]
[src]
pub struct DataStore { pub fields: Vec<DsField>, pub field_map: HashMap<FieldIdent, usize>, // some fields omitted }
Data storage underlying a dataframe. Data is retrievable both by index (of the fields vector) and by field name.
Fields
fields: Vec<DsField>
List of fields within the data store
field_map: HashMap<FieldIdent, usize>
Map of field names to index of the fields vector
Methods
impl DataStore
[src]
pub fn empty() -> DataStore
[src]
Generate and return an empty data store
pub fn with_fields(fields: Vec<TypedFieldIdent>) -> DataStore
[src]
Create a new DataStore
which will contain the provided fields.
pub fn with_data<FI, U, S, T, B, F>(
unsigned: U,
signed: S,
text: T,
boolean: B,
float: F
) -> DataStore where
FI: Into<FieldIdent>,
U: Into<Option<Vec<(FI, MaskedData<u64>)>>>,
S: Into<Option<Vec<(FI, MaskedData<i64>)>>>,
T: Into<Option<Vec<(FI, MaskedData<String>)>>>,
B: Into<Option<Vec<(FI, MaskedData<bool>)>>>,
F: Into<Option<Vec<(FI, MaskedData<f64>)>>>,
[src]
unsigned: U,
signed: S,
text: T,
boolean: B,
float: F
) -> DataStore where
FI: Into<FieldIdent>,
U: Into<Option<Vec<(FI, MaskedData<u64>)>>>,
S: Into<Option<Vec<(FI, MaskedData<i64>)>>>,
T: Into<Option<Vec<(FI, MaskedData<String>)>>>,
B: Into<Option<Vec<(FI, MaskedData<bool>)>>>,
F: Into<Option<Vec<(FI, MaskedData<f64>)>>>,
Create a new DataStore
with provided data. Data is provided in type-specific vectors of
field identifiers along with data for the identifier.
NOTE: This function provides no protection against field name collisions.
pub fn insert(
&mut self,
ty_ident: TypedFieldIdent,
value_str: String
) -> Result<()>
[src]
&mut self,
ty_ident: TypedFieldIdent,
value_str: String
) -> Result<()>
Insert a value (provided in unparsed string form) for specified field
pub fn has_field(&self, ident: &FieldIdent) -> bool
[src]
Returns true
if this DataStore
contains this field.
pub fn get_field_type(&self, ident: &FieldIdent) -> Option<FieldType>
[src]
Get the field information struct for a given field name
pub fn fields(&self) -> Vec<&TypedFieldIdent>
[src]
Get the list of field information structs for this data store
pub fn fieldnames(&self) -> Vec<String>
[src]
Get the field names in this data store
pub fn is_homogeneous(&self) -> bool
[src]
Check if datastore is "homogenous": all columns (regardless of field type) are the same length
pub fn nrows(&self) -> usize
[src]
Retrieve number of rows for this data store
Trait Implementations
impl Debug for DataStore
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for DataStore
[src]
fn clone(&self) -> DataStore
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for DataStore
[src]
impl<'a> ApplyToElem<FieldIndexSelector<'a>> for DataStore
[src]
fn apply_to_elem<F: ElemFn>(
&self,
f: F,
select: FieldIndexSelector
) -> Result<F::Output>
[src]
&self,
f: F,
select: FieldIndexSelector
) -> Result<F::Output>
Apply an ElemFn
to an element selected with the provided Selector
.
impl<'a> ApplyToField<FieldSelector<'a>> for DataStore
[src]
fn apply_to_field<F: FieldFn>(
&self,
f: F,
select: FieldSelector
) -> Result<F::Output>
[src]
&self,
f: F,
select: FieldSelector
) -> Result<F::Output>
Apply a FieldFn
to a field selected with the provided Selector
.
impl AddData<u64> for DataStore
[src]
fn add(&mut self, ident: FieldIdent, value: MaybeNa<u64>)
[src]
Add a single value to the specified field.
impl AddData<i64> for DataStore
[src]
fn add(&mut self, ident: FieldIdent, value: MaybeNa<i64>)
[src]
Add a single value to the specified field.
impl AddData<String> for DataStore
[src]
fn add(&mut self, ident: FieldIdent, value: MaybeNa<String>)
[src]
Add a single value to the specified field.
impl AddData<bool> for DataStore
[src]
fn add(&mut self, ident: FieldIdent, value: MaybeNa<bool>)
[src]
Add a single value to the specified field.
impl AddData<f64> for DataStore
[src]
fn add(&mut self, ident: FieldIdent, value: MaybeNa<f64>)
[src]
Add a single value to the specified field.