pub struct SparseRecord {
pub fields: PathFieldSet,
pub values: Vec<Value>,
}Expand description
A record where only a subset of fields are populated.
Unlike ValueRecord (which stores values for every field by position),
SparseRecord tracks which field indices are present via a
PathFieldSet and stores corresponding values. Fields not in the set
are absent (not merely null).
Iterating over a SparseRecord yields (usize, Value) pairs of field
index and value.
§Examples
use toasty_core::stmt::{Value, PathFieldSet};
// Create a sparse record with field 0 populated
let v = Value::empty_sparse_record();
assert!(matches!(v, Value::SparseRecord(_)));Fields§
§fields: PathFieldSetBit set of field indices that are populated in this record.
values: Vec<Value>Values indexed by field position. Indices not in fields contain
placeholder Value::Null entries.
Trait Implementations§
Source§impl Clone for SparseRecord
impl Clone for SparseRecord
Source§fn clone(&self) -> SparseRecord
fn clone(&self) -> SparseRecord
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SparseRecord
impl Debug for SparseRecord
Source§impl From<SparseRecord> for Value
impl From<SparseRecord> for Value
Source§fn from(value: SparseRecord) -> Self
fn from(value: SparseRecord) -> Self
Converts to this type from the input type.
Source§impl Hash for SparseRecord
impl Hash for SparseRecord
Source§impl IntoIterator for SparseRecord
impl IntoIterator for SparseRecord
Source§impl PartialEq for SparseRecord
impl PartialEq for SparseRecord
impl Eq for SparseRecord
impl StructuralPartialEq for SparseRecord
Auto Trait Implementations§
impl Freeze for SparseRecord
impl RefUnwindSafe for SparseRecord
impl Send for SparseRecord
impl Sync for SparseRecord
impl Unpin for SparseRecord
impl UnwindSafe for SparseRecord
Blanket Implementations§
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.