Struct agnes::view::DataView
[−]
[src]
pub struct DataView { /* fields omitted */ }
A 'view' into a data store. The primary struct for viewing and manipulating data.
Methods
impl DataView
[src]
pub fn v<L: IntoFieldList>(&self, s: L) -> DataView
[src]
Generate a new subview of this DataView.
pub fn subview<L: IntoFieldList>(&self, s: L) -> Result<DataView>
[src]
Generate a new subview of this DataView, generating an error if a specified field does not exist.
pub fn nrows(&self) -> usize
[src]
Number of rows in this data view
pub fn is_empty(&self) -> bool
[src]
Returns true
if the DataView is empty (has no rows or has no fields)
pub fn nfields(&self) -> usize
[src]
Number of fields in this data view
pub fn fieldnames(&self) -> Vec<&FieldIdent>
[src]
Field names in this data view
pub fn get_field_type(&self, ident: &FieldIdent) -> Option<FieldType>
[src]
Return the field type for specified field
pub fn has_field(&self, s: &FieldIdent) -> bool
[src]
Returns true
if this DataView
contains this field.
pub fn rename<T, U>(&mut self, orig: T, new: U) -> Result<()> where
T: Into<FieldIdent>,
U: Into<FieldIdent>,
[src]
T: Into<FieldIdent>,
U: Into<FieldIdent>,
Rename a field of this DataView.
pub fn merge(&self, other: &DataView) -> Result<DataView>
[src]
Merge this DataView
with another DataView
object, creating a new DataView
with the
same number of rows and all the fields from both source DataView
objects.
pub fn join(&self, other: &DataView, join: Join) -> Result<DataStore>
[src]
Combine two DataView
objects using specified join, creating a new DataStore
object with
a subset of records from the two source DataView
s according to the join parameters.
Note that since this is creating a new DataStore
object, it will be allocated new data to
store the contents of the joined DataView
s.
impl DataView
[src]
pub fn as_fieldview(&self) -> Option<FieldView>
[src]
Create a FieldView
object from a DataView
object, if possible. Typically, use this on
DataView
objects with only a single field; however, if the DataView
object has multiple
fields, the first one will be used for this FieldView
. Returns None
if the DataView
has no fields (is empty).
Trait Implementations
impl Debug for DataView
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for DataView
[src]
fn clone(&self) -> DataView
[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 DataView
[src]
impl<T> Filter<T> for DataView where
DataFrame: Filter<T>,
[src]
DataFrame: Filter<T>,
fn filter<F: Fn(&T) -> bool>(
&mut self,
ident: &FieldIdent,
pred: F
) -> Result<Vec<usize>>
[src]
&mut self,
ident: &FieldIdent,
pred: F
) -> Result<Vec<usize>>
Filter the contents of this data structure by applying the supplied predicate on the specified field. Read more
impl SortBy for DataView
[src]
fn sort_by(&mut self, ident: &FieldIdent) -> Result<Vec<usize>>
[src]
Sort the contents of this data structure (ascending) by the specified field.
impl<'a> ApplyToElem<FieldIndexSelector<'a>> for DataView
[src]
fn apply_to_elem<T: ElemFn>(
&self,
f: T,
select: FieldIndexSelector<'a>
) -> Result<T::Output>
[src]
&self,
f: T,
select: FieldIndexSelector<'a>
) -> Result<T::Output>
Apply an ElemFn
to an element selected with the provided Selector
.
impl<'a> ApplyToField<FieldSelector<'a>> for DataView
[src]
fn apply_to_field<T: FieldFn>(
&self,
f: T,
select: FieldSelector
) -> Result<T::Output>
[src]
&self,
f: T,
select: FieldSelector
) -> Result<T::Output>
Apply a FieldFn
to a field selected with the provided Selector
.
impl<'a> ApplyToField2<FieldSelector<'a>> for DataView
[src]
fn apply_to_field2<T: Field2Fn>(
&self,
f: T,
select: (FieldSelector, FieldSelector)
) -> Result<T::Output>
[src]
&self,
f: T,
select: (FieldSelector, FieldSelector)
) -> Result<T::Output>
Apply a Field2Fn
(a function that operates simultaneously on fields from two different sources) to fields selected with the provided Selector
s. Read more
impl From<DataStore> for DataView
[src]
impl Display for DataView
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more