pub struct CompactRow { /* private fields */ }Expand description
A database result row whose column names are shared by the whole result set.
Providers use this representation for typed decoding so a 100-row result does not allocate 100 copies of every projected column name (or 100 B-trees).
Implementations§
Source§impl CompactRow
impl CompactRow
pub fn new(columns: Arc<[String]>, values: Vec<Value>) -> Self
pub fn get(&self, name: &str) -> Option<&Value>
pub fn get_mut(&mut self, name: &str) -> Option<&mut Value>
Sourcepub fn insert(&mut self, name: String, value: Value) -> Option<Value>
pub fn insert(&mut self, name: String, value: Value) -> Option<Value>
Adds or replaces a projected value. Column layouts remain shared until an enhancement actually changes the shape of this row.
pub fn remove(&mut self, name: &str) -> Option<Value>
pub fn extend(&mut self, other: CompactRow)
pub fn contains_key(&self, name: &str) -> bool
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> impl Iterator<Item = (&String, &Value)>
pub fn keys(&self) -> impl Iterator<Item = &String>
pub fn values(&self) -> impl Iterator<Item = &Value>
pub fn into_map(self) -> BTreeMap<String, Value>
Trait Implementations§
Source§impl Clone for CompactRow
impl Clone for CompactRow
Source§fn clone(&self) -> CompactRow
fn clone(&self) -> CompactRow
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CompactRow
impl Debug for CompactRow
Source§impl PartialEq for CompactRow
impl PartialEq for CompactRow
impl StructuralPartialEq for CompactRow
Auto Trait Implementations§
impl Freeze for CompactRow
impl RefUnwindSafe for CompactRow
impl Send for CompactRow
impl Sync for CompactRow
impl Unpin for CompactRow
impl UnsafeUnpin for CompactRow
impl UnwindSafe for CompactRow
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