Struct agnes::store::DataStore [−][src]
pub struct DataStore<DTypes: AssocTypes> { /* fields omitted */ }
Data storage underlying a dataframe. Data is retrievable both by index (of the fields vector) and by field name.
DataStores are growable (through AddData
and AddDataVec
), but existing data is immutable.
Methods
impl<DTypes> DataStore<DTypes> where
DTypes: AssocTypes,
DTypes::Storage: CreateStorage,
[src]
impl<DTypes> DataStore<DTypes> where
DTypes: AssocTypes,
DTypes::Storage: CreateStorage,
impl<DTypes> DataStore<DTypes> where
DTypes: DTypeList,
[src]
impl<DTypes> DataStore<DTypes> where
DTypes: DTypeList,
pub fn map<F, FOut>(&self, ident: &FieldIdent, f: F) -> Result<FOut> where
DTypes::Storage: Map<DTypes, F, FOut>,
[src]
pub fn map<F, FOut>(&self, ident: &FieldIdent, f: F) -> Result<FOut> where
DTypes::Storage: Map<DTypes, F, FOut>,
Applies the provided Func
to the data in the specified field. This Func
must be
implemented for all types in DTypes
.
Fails if the specified identifier is not found in this DataStore
.
pub fn tmap<T, F>(&self, ident: &FieldIdent, f: F) -> Result<F::Output> where
F: Func<DTypes, T>,
T: DataType<DTypes>,
DTypes::Storage: TMap<DTypes, T, F>,
[src]
pub fn tmap<T, F>(&self, ident: &FieldIdent, f: F) -> Result<F::Output> where
F: Func<DTypes, T>,
T: DataType<DTypes>,
DTypes::Storage: TMap<DTypes, T, F>,
Applies the provided Func
to the data in the specified field. This Func
must be
implemented for type T
.
Fails if the specified identifier is not found in this DataStore
or the incorrect type T
is used.
pub fn map_ext<F, FOut>(&self, ident: &FieldIdent, f: F) -> Result<FOut> where
DTypes::Storage: MapExt<DTypes, F, FOut>,
[src]
pub fn map_ext<F, FOut>(&self, ident: &FieldIdent, f: F) -> Result<FOut> where
DTypes::Storage: MapExt<DTypes, F, FOut>,
Applies the provided FuncExt
to the data in the specified field. This FuncExt
must be
implemented for all types in DTypes
.
Fails if the specified identifier is not found in this DataStore
.
pub fn map_partial<F, R>(
&self,
ident: &FieldIdent,
reindexer: &R,
f: F
) -> Result<Option<F::Output>> where
DTypes::Storage: MapPartial<DTypes, F>,
F: FuncPartial<DTypes>,
R: Reindexer<DTypes>,
[src]
pub fn map_partial<F, R>(
&self,
ident: &FieldIdent,
reindexer: &R,
f: F
) -> Result<Option<F::Output>> where
DTypes::Storage: MapPartial<DTypes, F>,
F: FuncPartial<DTypes>,
R: Reindexer<DTypes>,
Applies the provided FuncPartial
to the data in the specified field.
Fails if the specified identifier is not found in this DataStore
.
impl<DTypes: AssocTypes> DataStore<DTypes>
[src]
impl<DTypes: AssocTypes> DataStore<DTypes>
pub fn fields(
&self
) -> impl Iterator<Item = &FieldIdent>
[src]
pub fn fields(
&self
) -> impl Iterator<Item = &FieldIdent>
Returns an iterator of FieldIdents contained in this
DataStore
.
pub fn has_field(&self, ident: &FieldIdent) -> bool
[src]
pub fn has_field(&self, ident: &FieldIdent) -> bool
Returns true
if this DataStore
contains this field.
pub fn get_field_type(&self, ident: &FieldIdent) -> Option<DTypes::DType>
[src]
pub fn get_field_type(&self, ident: &FieldIdent) -> Option<DTypes::DType>
Get the field information struct for a given field name
pub fn nrows(&self) -> usize where
DTypes: AssocTypes,
DTypes::Storage: MaxLen<DTypes>,
[src]
pub fn nrows(&self) -> usize where
DTypes: AssocTypes,
DTypes::Storage: MaxLen<DTypes>,
Retrieve number of rows for this data store
impl<DTypes> DataStore<DTypes> where
DTypes: DTypeList,
[src]
impl<DTypes> DataStore<DTypes> where
DTypes: DTypeList,
pub fn add<T, V>(&mut self, ident: FieldIdent, value: V) -> Result<()> where
T: 'static + DataType<DTypes> + Default,
V: Into<Value<T>>,
Self: AddData<T, DTypes>,
DTypes::Storage: TypeSelector<DTypes, T>,
[src]
pub fn add<T, V>(&mut self, ident: FieldIdent, value: V) -> Result<()> where
T: 'static + DataType<DTypes> + Default,
V: Into<Value<T>>,
Self: AddData<T, DTypes>,
DTypes::Storage: TypeSelector<DTypes, T>,
Add a field to this DataStore
with ident
and value
.
impl<DTypes> DataStore<DTypes> where
DTypes: DTypeList,
[src]
impl<DTypes> DataStore<DTypes> where
DTypes: DTypeList,
pub fn with_data_vec<T: DataType<DTypes>, I: Into<FieldIdent>, V: Into<Value<T>>>(
self,
ident: I,
data: Vec<V>
) -> Result<Self> where
Self: WithDataVec<T, DTypes>,
DTypes::Storage: TypeSelector<DTypes, T>,
[src]
pub fn with_data_vec<T: DataType<DTypes>, I: Into<FieldIdent>, V: Into<Value<T>>>(
self,
ident: I,
data: Vec<V>
) -> Result<Self> where
Self: WithDataVec<T, DTypes>,
DTypes::Storage: TypeSelector<DTypes, T>,
Consume the DataStore
, add the data
to a new field ident
, and return the new
DataStore
.
Trait Implementations
impl<DTypes: Debug + AssocTypes> Debug for DataStore<DTypes> where
DTypes::Storage: Debug,
[src]
impl<DTypes: Debug + AssocTypes> Debug for DataStore<DTypes> where
DTypes::Storage: Debug,
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<DTypes> Default for DataStore<DTypes> where
DTypes: AssocTypes,
DTypes::Storage: CreateStorage,
[src]
impl<DTypes> Default for DataStore<DTypes> where
DTypes: AssocTypes,
DTypes::Storage: CreateStorage,
impl<'a, DTypes, T> SelectField<'a, T, DTypes> for DataStore<DTypes> where
T: 'static + DataType<DTypes>,
DTypes: 'a + DTypeList,
[src]
impl<'a, DTypes, T> SelectField<'a, T, DTypes> for DataStore<DTypes> where
T: 'static + DataType<DTypes>,
DTypes: 'a + DTypeList,
type Output = OwnedOrRef<'a, DTypes, T>
The return type for the select
method.
fn select(&'a self, ident: FieldIdent) -> Result<OwnedOrRef<'a, DTypes, T>> where
DTypes::Storage: TypeSelector<DTypes, T>,
[src]
fn select(&'a self, ident: FieldIdent) -> Result<OwnedOrRef<'a, DTypes, T>> where
DTypes::Storage: TypeSelector<DTypes, T>,
Returns an object that provides DataIndex access to the data in the field specified by ident
. Read more
impl<DTypes, T> AddData<T, DTypes> for DataStore<DTypes> where
T: 'static + DataType<DTypes> + Default + Clone,
DTypes: DTypeList,
DTypes::Storage: TypeSelector<DTypes, T> + DTypeSelector<DTypes, T>,
[src]
impl<DTypes, T> AddData<T, DTypes> for DataStore<DTypes> where
T: 'static + DataType<DTypes> + Default + Clone,
DTypes: DTypeList,
DTypes::Storage: TypeSelector<DTypes, T> + DTypeSelector<DTypes, T>,
fn add<V: Into<Value<T>>>(&mut self, ident: FieldIdent, value: V) -> Result<()>
[src]
fn add<V: Into<Value<T>>>(&mut self, ident: FieldIdent, value: V) -> Result<()>
Add a single value to the specified field.
impl<DTypes, T> AddDataVec<T, DTypes> for DataStore<DTypes> where
T: 'static + DataType<DTypes> + Default + Clone,
DTypes: DTypeList,
DTypes::Storage: TypeSelector<DTypes, T> + DTypeSelector<DTypes, T>,
[src]
impl<DTypes, T> AddDataVec<T, DTypes> for DataStore<DTypes> where
T: 'static + DataType<DTypes> + Default + Clone,
DTypes: DTypeList,
DTypes::Storage: TypeSelector<DTypes, T> + DTypeSelector<DTypes, T>,
fn add_data_vec<I: Into<FieldIdent>, V: Into<Value<T>>>(
&mut self,
ident: I,
data: Vec<V>
) -> Result<()>
[src]
fn add_data_vec<I: Into<FieldIdent>, V: Into<Value<T>>>(
&mut self,
ident: I,
data: Vec<V>
) -> Result<()>
Add a vector of data values to the specified field.
impl<DTypes, T> AddDataFromIter<T, DTypes> for DataStore<DTypes> where
T: 'static + DataType<DTypes> + Default + Clone,
DTypes: DTypeList,
DTypes::Storage: TypeSelector<DTypes, T> + DTypeSelector<DTypes, T>,
[src]
impl<DTypes, T> AddDataFromIter<T, DTypes> for DataStore<DTypes> where
T: 'static + DataType<DTypes> + Default + Clone,
DTypes: DTypeList,
DTypes::Storage: TypeSelector<DTypes, T> + DTypeSelector<DTypes, T>,
fn add_data_from_iter<I, Iter, V>(&mut self, ident: I, iter: Iter) -> Result<()> where
I: Into<FieldIdent>,
V: Into<Value<T>>,
Iter: Iterator<Item = V>,
[src]
fn add_data_from_iter<I, Iter, V>(&mut self, ident: I, iter: Iter) -> Result<()> where
I: Into<FieldIdent>,
V: Into<Value<T>>,
Iter: Iterator<Item = V>,
Add data to self
with provided field identifier from an iterator over items of type Value<T>
. Read more
impl<'a, DTypes, T> AddClonedDataFromIter<'a, T, DTypes> for DataStore<DTypes> where
T: 'static + DataType<DTypes> + Default + Clone,
DTypes: DTypeList,
DTypes::Storage: TypeSelector<DTypes, T> + DTypeSelector<DTypes, T>,
[src]
impl<'a, DTypes, T> AddClonedDataFromIter<'a, T, DTypes> for DataStore<DTypes> where
T: 'static + DataType<DTypes> + Default + Clone,
DTypes: DTypeList,
DTypes::Storage: TypeSelector<DTypes, T> + DTypeSelector<DTypes, T>,
fn add_cloned_data_from_iter<I, Iter, V>(
&mut self,
ident: I,
iter: Iter
) -> Result<()> where
I: Into<FieldIdent>,
V: Into<Value<&'a T>>,
Iter: Iterator<Item = V>,
[src]
fn add_cloned_data_from_iter<I, Iter, V>(
&mut self,
ident: I,
iter: Iter
) -> Result<()> where
I: Into<FieldIdent>,
V: Into<Value<&'a T>>,
Iter: Iterator<Item = V>,
Add data to self
with provided field identifier from an iterator over items of type Value<&T>
, cloning the values. Read more
impl<'a, DTypes, T> WithClonedDataFromIter<'a, T, DTypes> for DataStore<DTypes> where
T: 'static + DataType<DTypes> + Default,
DTypes: DTypeList,
DTypes::Storage: TypeSelector<DTypes, T>,
DataStore<DTypes>: AddClonedDataFromIter<'a, T, DTypes>,
[src]
impl<'a, DTypes, T> WithClonedDataFromIter<'a, T, DTypes> for DataStore<DTypes> where
T: 'static + DataType<DTypes> + Default,
DTypes: DTypeList,
DTypes::Storage: TypeSelector<DTypes, T>,
DataStore<DTypes>: AddClonedDataFromIter<'a, T, DTypes>,
fn with_cloned_data_from_iter<I, Iter, V>(
self,
ident: I,
iter: Iter
) -> Result<Self> where
I: Into<FieldIdent>,
V: Into<Value<&'a T>>,
Iter: Iterator<Item = V>,
[src]
fn with_cloned_data_from_iter<I, Iter, V>(
self,
ident: I,
iter: Iter
) -> Result<Self> where
I: Into<FieldIdent>,
V: Into<Value<&'a T>>,
Iter: Iterator<Item = V>,
Consume the data structure, clone the data from iter
into a new field ident
, and return the new data structure. Read more
impl<DTypes> From<DataStore<DTypes>> for DataView<DTypes> where
DTypes: DTypeList,
[src]
impl<DTypes> From<DataStore<DTypes>> for DataView<DTypes> where
DTypes: DTypeList,
impl<DTypes> From<DataStore<DTypes>> for DataFrame<DTypes> where
DTypes: DTypeList,
[src]
impl<DTypes> From<DataStore<DTypes>> for DataFrame<DTypes> where
DTypes: DTypeList,
Auto Trait Implementations
impl<DTypes> Send for DataStore<DTypes> where
<DTypes as AssocTypes>::DType: Send,
<DTypes as AssocTypes>::Storage: Send,
impl<DTypes> Send for DataStore<DTypes> where
<DTypes as AssocTypes>::DType: Send,
<DTypes as AssocTypes>::Storage: Send,
impl<DTypes> Sync for DataStore<DTypes> where
<DTypes as AssocTypes>::DType: Sync,
<DTypes as AssocTypes>::Storage: Sync,
impl<DTypes> Sync for DataStore<DTypes> where
<DTypes as AssocTypes>::DType: Sync,
<DTypes as AssocTypes>::Storage: Sync,