pub struct FieldData<T> { /* private fields */ }Expand description
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.
Implementations§
Source§impl<T> FieldData<T>
impl<T> FieldData<T>
Sourcepub fn get(&self, index: usize) -> Option<Value<&T>>
pub fn get(&self, index: usize) -> Option<Value<&T>>
Get the value at the given index. Returns None if index is out of bounds, or a
Value enum.
Sourcepub fn take(&mut self, index: usize) -> Option<Value<T>>where
T: Default,
pub fn take(&mut self, index: usize) -> Option<Value<T>>where
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.
Sourcepub fn from_boxed_slice(orig: Box<[T]>) -> Self
pub fn from_boxed_slice(orig: Box<[T]>) -> Self
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.
Trait Implementations§
Source§impl<T> DataIndex for FieldData<T>where
T: Debug,
impl<T> DataIndex for FieldData<T>where
T: Debug,
Source§fn get_datum(&self, idx: usize) -> Result<Value<&T>>
fn get_datum(&self, idx: usize) -> Result<Value<&T>>
Returns the data (possibly NA) at the specified index, if it exists.
Source§fn iter(&self) -> DataIterator<'_, Self::DType> ⓘwhere
Self: Sized,
fn iter(&self) -> DataIterator<'_, Self::DType> ⓘwhere
Self: Sized,
Returns an iterator over the values in this field.
Source§fn permute(self, permutation: &[usize]) -> Framed<Self::DType, Self>where
Self: Sized,
fn permute(self, permutation: &[usize]) -> Framed<Self::DType, Self>where
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.Source§impl<T> DataIndexMut for FieldData<T>
impl<T> DataIndexMut for FieldData<T>
impl<T: Eq> Eq for FieldData<T>
Source§impl<T> FromIterator<T> for FieldData<T>
impl<T> FromIterator<T> for FieldData<T>
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<T> FromIterator<Value<T>> for FieldData<T>
impl<T> FromIterator<Value<T>> for FieldData<T>
Source§impl<Label, T> IntoStore<Label> for FieldData<T>
impl<Label, T> IntoStore<Label> for FieldData<T>
Source§type Output = DataStore<<DataStore<Nil> as PushFrontFromValueIter<Label, T>>::OutputFields>
type Output = DataStore<<DataStore<Nil> as PushFrontFromValueIter<Label, T>>::OutputFields>
The reulting
DataStore object.Source§fn into_store(self) -> Self::Output
fn into_store(self) -> Self::Output
Wraps this field data in a
DataStore and returns it.Source§impl<T: PartialEq> PartialEq for FieldData<T>
impl<T: PartialEq> PartialEq for FieldData<T>
impl<T> SelfValued for FieldData<T>
Source§impl<T> Serialize for FieldData<T>where
T: Serialize,
Available on crate feature serialize only.
impl<T> Serialize for FieldData<T>where
T: Serialize,
Available on crate feature
serialize only.impl<T: PartialEq> StructuralPartialEq for FieldData<T>
Auto Trait Implementations§
impl<T> Freeze for FieldData<T>
impl<T> RefUnwindSafe for FieldData<T>where
T: RefUnwindSafe,
impl<T> Send for FieldData<T>where
T: Send,
impl<T> Sync for FieldData<T>where
T: Sync,
impl<T> Unpin for FieldData<T>where
T: Unpin,
impl<T> UnsafeUnpin for FieldData<T>
impl<T> UnwindSafe for FieldData<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<Frames> AssocDataIndexCons<Nil> for Frames
impl<Frames> AssocDataIndexCons<Nil> for Frames
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<DI, P> FilterPerm<P> for DI
impl<DI, P> FilterPerm<P> for DI
Source§fn filter_perm(&self, predicate: P) -> Vec<usize>
fn filter_perm(&self, predicate: P) -> Vec<usize>
Returns the permutation indices of this field which match the specified
predicate.impl<T> HasLabels<Nil> for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoLabeled for T
impl<T> IntoLabeled for T
Source§impl<Frames, Store> JoinIntoStore<Nil, Store> for Frames
impl<Frames, Store> JoinIntoStore<Nil, Store> for Frames
Source§fn join_into_store(
&self,
store: Store,
_permutation: &[usize],
) -> Result<Store, AgnesError>
fn join_into_store( &self, store: Store, _permutation: &[usize], ) -> Result<Store, AgnesError>
Augments
store with data from self (as specified with Labels), using the provided
permutation indices.Source§impl<DI, F> SortOrderComparator<F> for DI
impl<DI, F> SortOrderComparator<F> for DI
Source§fn sort_order_by(&self, compare: F) -> Vec<usize>
fn sort_order_by(&self, compare: F) -> Vec<usize>
Returns the stable sorted permutation order (
Vec<usize>) using the specified comparator.Source§impl<DI, F> SortOrderUnstableComparator<F> for DI
impl<DI, F> SortOrderUnstableComparator<F> for DI
Source§fn sort_order_unstable_by(&self, compare: F) -> Vec<usize>
fn sort_order_unstable_by(&self, compare: F) -> Vec<usize>
Returns the unstable sorted permutation order (
Vec<usize>) using the specified comparator.