[−][src]Struct agnes::field::FieldData
Data vector containing the data for a single field (column) of an agnes data store.
To support NA / missing values, a FieldData
object is internally represented as a Vec
of the
appropriate type, along with a bit mask to denote valid / missing values.
Methods
impl<T> FieldData<T>
[src]
pub fn len(&self) -> usize
[src]
Returns the length of this data vector.
pub fn is_empty(&self) -> bool
[src]
Returns true
if this field contains no values.
pub fn get(&self, index: usize) -> Option<Value<&T>>
[src]
Get the value at the given index. Returns None
if index
is out of bounds, or a
Value
enum.
pub fn take(&mut self, index: usize) -> Option<Value<T>> where
T: Default,
[src]
T: Default,
Take the value at the given index. Returns None
if index
is out of bounds, or a
Value enum. Replaces the taken value with Value::Na
.
pub fn as_vec(&self) -> Vec<Value<&T>> where
FieldData<T>: DataIndex<DType = T>,
[src]
FieldData<T>: DataIndex<DType = T>,
Interpret FieldData
as a Vec
of Value
objects.
pub fn from_boxed_slice(orig: Box<[T]>) -> Self
[src]
Create a new FieldData
from a slice. Does not clone or reallocate the contained data (but
does allocate the bit mask). Resulting FieldData
struct will have no Value::Na
values.
impl<T> FieldData<T>
[src]
pub fn from_vec<U: Into<T>>(v: Vec<U>) -> FieldData<T>
[src]
Create a FieldData
struct from a vector of non-NA values. Resulting FieldData
struct
will have no Value::Na
values.
impl<T> FieldData<T> where
T: Debug + Default,
[src]
T: Debug + Default,
pub fn push_val(&mut self, value: Value<T>)
[src]
Add a new value (or an indication of a missing one) to the data vector.
impl<T> FieldData<T> where
T: Debug + Default + Clone,
[src]
T: Debug + Default + Clone,
pub fn push_ref(&mut self, value: Value<&T>)
[src]
Add a new value (passed by reference) to the data vector.
pub fn from_field_vec(v: Vec<Value<T>>) -> FieldData<T>
[src]
Create a FieldData
struct from a vector of field values.
Trait Implementations
impl<T> Typed for FieldData<T>
[src]
type DType = T
Associated data type with this type.
impl<T> SelfValued for FieldData<T>
[src]
impl<Label, T> IntoStore<Label> for FieldData<T> where
Label: Debug,
T: Default + Debug,
[src]
Label: Debug,
T: Default + Debug,
type Output = SingleFieldStore<Label, T>
The reulting DataStore
object.
fn into_store(self) -> Self::Output
[src]
impl<T> DataIndex for FieldData<T> where
T: Debug,
[src]
T: Debug,
type DType = T
The data type contained within this field.
fn get_datum(&self, idx: usize) -> Result<Value<&T>>
[src]
fn len(&self) -> usize
[src]
fn is_empty(&self) -> bool
[src]
Returns whether or not this field is empty.
ⓘImportant traits for DataIterator<'a, T>fn iter(&self) -> DataIterator<Self::DType> where
Self: Sized,
[src]
Self: Sized,
Returns an iterator over the values in this field.
fn permute(self, permutation: &[usize]) -> Framed<Self::DType, Self> where
Self: Sized,
[src]
Self: Sized,
Returns a new DataIndex
-implementing object which provides access to the values in this field as permuted by permutation
. permutation
is a slice of indices into this DataIndex
. Read more
fn to_vec(&self) -> Vec<Self::DType> where
Self: Sized,
Self::DType: Clone,
[src]
Self: Sized,
Self::DType: Clone,
Copies existing values in this field into a new Vec
. Read more
fn to_value_vec(&self) -> Vec<Value<Self::DType>> where
Self: Sized,
Self::DType: Clone,
[src]
Self: Sized,
Self::DType: Clone,
Copies values (missing or existing) in this field into a new Vec
.
impl<T> DataIndexMut for FieldData<T> where
T: Debug + Default,
[src]
T: Debug + Default,
fn push(&mut self, value: Value<Self::DType>)
[src]
fn take_datum(&mut self, idx: usize) -> Result<Value<T>> where
T: Default,
[src]
T: Default,
ⓘImportant traits for DrainIterator<'a, T>fn drain(&mut self) -> DrainIterator<Self::DType> where
Self: Sized,
[src]
Self: Sized,
Returns a draining iterator of the vaules in this DataIndexMut
.
impl<T: Eq> Eq for FieldData<T>
[src]
impl<T: PartialEq> PartialEq<FieldData<T>> for FieldData<T>
[src]
impl<T: Clone> Clone for FieldData<T>
[src]
fn clone(&self) -> FieldData<T>
[src]
default fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T> Default for FieldData<T>
[src]
impl<T> From<FieldData<T>> for DataRef<T>
[src]
impl<T> From<Vec<T>> for FieldData<T>
[src]
impl<T> From<FieldData<T>> for Framed<T, DataRef<T>>
[src]
impl<T: Debug> Debug for FieldData<T>
[src]
impl<T> FromIterator<Value<T>> for FieldData<T> where
T: Debug + Default,
[src]
T: Debug + Default,
fn from_iter<I: IntoIterator<Item = Value<T>>>(iter: I) -> Self
[src]
impl<'a, T> FromIterator<Value<&'a T>> for FieldData<T> where
T: 'a + Debug + Default + Clone,
[src]
T: 'a + Debug + Default + Clone,
fn from_iter<I: IntoIterator<Item = Value<&'a T>>>(iter: I) -> Self
[src]
impl<T> FromIterator<T> for FieldData<T>
[src]
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
[src]
impl<T: Hash> Hash for FieldData<T>
[src]
fn hash<__HT: Hasher>(&self, state: &mut __HT)
[src]
default fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T> Serialize for FieldData<T> where
T: Serialize,
[src]
T: Serialize,
Auto Trait Implementations
Blanket Implementations
impl<T> IntoLabeled for T
[src]
impl<T> Valued for T where
T: SelfValued,
[src]
T: SelfValued,
type Value = T
The associated value.
fn value_ref(&Self) -> &T
[src]
fn value_mut(&mut Self) -> &mut T
[src]
fn value(Self) -> <T as Valued>::Value
[src]
impl<T> HasLabels for T
[src]
impl<Needle, Haystack> HasLabels for Haystack where
Haystack: Member<Needle, IsMember = B1>,
Needle: Label,
[src]
Haystack: Member<Needle, IsMember = B1>,
Needle: Label,
impl<DI> NRows for DI where
DI: DataIndex,
[src]
DI: DataIndex,
impl<Frames, Store> JoinIntoStore for Frames
[src]
type Output = Store
The output type after augmenting Store
.
fn join_into_store(&Self, Store, &[usize]) -> Result<Store, AgnesError>
[src]
impl<DI> SortOrder for DI where
DI: DataIndex,
<DI as DataIndex>::DType: Ord,
[src]
DI: DataIndex,
<DI as DataIndex>::DType: Ord,
fn sort_order(&Self) -> Vec<usize>
[src]
impl<DI> SortOrderUnstable for DI where
DI: DataIndex,
<DI as DataIndex>::DType: Ord,
[src]
DI: DataIndex,
<DI as DataIndex>::DType: Ord,
fn sort_order_unstable(&Self) -> Vec<usize>
[src]
impl<DI, F> SortOrderComparator for DI where
DI: DataIndex,
F: FnMut(Value<&<DI as DataIndex>::DType>, Value<&<DI as DataIndex>::DType>) -> Ordering,
[src]
DI: DataIndex,
F: FnMut(Value<&<DI as DataIndex>::DType>, Value<&<DI as DataIndex>::DType>) -> Ordering,
fn sort_order_by(&Self, F) -> Vec<usize>
[src]
impl<DI, F> SortOrderUnstableComparator for DI where
DI: DataIndex,
F: FnMut(Value<&<DI as DataIndex>::DType>, Value<&<DI as DataIndex>::DType>) -> Ordering,
[src]
DI: DataIndex,
F: FnMut(Value<&<DI as DataIndex>::DType>, Value<&<DI as DataIndex>::DType>) -> Ordering,
fn sort_order_unstable_by(&Self, F) -> Vec<usize>
[src]
impl<DI, P> FilterPerm for DI where
DI: DataIndex,
P: FnMut(Value<&<DI as DataIndex>::DType>) -> bool,
[src]
DI: DataIndex,
P: FnMut(Value<&<DI as DataIndex>::DType>) -> bool,
fn filter_perm(&Self, P) -> Vec<usize>
[src]
impl<DI> NaCount for DI where
DI: DataIndex,
[src]
DI: DataIndex,
impl<DI> Sum for DI where
DI: DataIndex,
<DI as DataIndex>::DType: Add<&'a <DI as DataIndex>::DType>,
<DI as DataIndex>::DType: Zero,
<<DI as DataIndex>::DType as Add<&'a <DI as DataIndex>::DType>>::Output == <DI as DataIndex>::DType,
[src]
DI: DataIndex,
<DI as DataIndex>::DType: Add<&'a <DI as DataIndex>::DType>,
<DI as DataIndex>::DType: Zero,
<<DI as DataIndex>::DType as Add<&'a <DI as DataIndex>::DType>>::Output == <DI as DataIndex>::DType,
type Output = <DI as DataIndex>::DType
The data type of the sum result.
fn sum(&Self) -> <DI as Sum>::Output
[src]
impl<DI> Mean for DI where
DI: DataIndex + NaCount + Sum,
<DI as Sum>::Output: AsPrimitive<f64>,
[src]
DI: DataIndex + NaCount + Sum,
<DI as Sum>::Output: AsPrimitive<f64>,
impl<DI> SumSq for DI where
DI: DataIndex,
<DI as DataIndex>::DType: Add<&'a <DI as DataIndex>::DType>,
<DI as DataIndex>::DType: Zero,
&'a <DI as DataIndex>::DType: Mul<&'b <DI as DataIndex>::DType>,
<<DI as DataIndex>::DType as Add<&'a <DI as DataIndex>::DType>>::Output == <DI as DataIndex>::DType,
<&'a <DI as DataIndex>::DType as Mul<&'b <DI as DataIndex>::DType>>::Output == <DI as DataIndex>::DType,
[src]
DI: DataIndex,
<DI as DataIndex>::DType: Add<&'a <DI as DataIndex>::DType>,
<DI as DataIndex>::DType: Zero,
&'a <DI as DataIndex>::DType: Mul<&'b <DI as DataIndex>::DType>,
<<DI as DataIndex>::DType as Add<&'a <DI as DataIndex>::DType>>::Output == <DI as DataIndex>::DType,
<&'a <DI as DataIndex>::DType as Mul<&'b <DI as DataIndex>::DType>>::Output == <DI as DataIndex>::DType,
type Output = <DI as DataIndex>::DType
The data type of the sum result.
fn sum_sq(&Self) -> <DI as DataIndex>::DType
[src]
impl<DI> Variance for DI where
DI: DataIndex + SumSq + NaCount + Mean,
<DI as SumSq>::Output: AsPrimitive<f64>,
[src]
DI: DataIndex + SumSq + NaCount + Mean,
<DI as SumSq>::Output: AsPrimitive<f64>,
fn var(&Self) -> f64
[src]
fn varp(&Self) -> f64
[src]
fn stdev(&self) -> f64
[src]
Computes sample standard deviation of this field. Ignores missing values in this computation. If all values are missing, returns 0.0
. Read more
fn stdevp(&self) -> f64
[src]
Computes population standard deviation of this field. Ignores missing values in this computation. If all values are missing, returns 0.0
. Read more
impl<DI> Extrema for DI where
DI: DataIndex,
<DI as DataIndex>::DType: PartialOrd<<DI as DataIndex>::DType>,
[src]
DI: DataIndex,
<DI as DataIndex>::DType: PartialOrd<<DI as DataIndex>::DType>,
type Output = <DI as DataIndex>::DType
The data type of the upper and lower values.
fn min(&Self) -> Option<&<DI as DataIndex>::DType>
[src]
fn max(&Self) -> Option<&<DI as DataIndex>::DType>
[src]
impl<Frames> AssocDataIndexCons for Frames
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<Q, K> Equivalent for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> Erased for T
impl<Q, K> Equivalent for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> Same for T
[src]
type Output = T
Should always be Self