pub struct DynamicRow { /* private fields */ }Expand description
A row decoded into the dynamic CellValue vocabulary.
Values are stored in column order and can be accessed by zero-based index or by raw column name.
Implementations§
Source§impl DynamicRow
impl DynamicRow
Sourcepub fn value(&self, name: &str) -> StdResult<&CellValue, SchemaError>
pub fn value(&self, name: &str) -> StdResult<&CellValue, SchemaError>
Borrow the value of a column resolved by raw label (case-sensitive).
§Errors
Returns SchemaError::MissingColumn when no column carries the name, or SchemaError::AmbiguousColumn when several do.
Sourcepub fn value_at(&self, index: usize) -> StdResult<&CellValue, SchemaError>
pub fn value_at(&self, index: usize) -> StdResult<&CellValue, SchemaError>
Borrow the value at a zero-based column index.
§Errors
Returns SchemaError::InvalidColumnIndex when index is out of range for this row’s schema.
Sourcepub fn take(&mut self, name: &str) -> StdResult<CellValue, SchemaError>
pub fn take(&mut self, name: &str) -> StdResult<CellValue, SchemaError>
Move a value out of the row by raw label, replacing the slot with
CellValue::Null.
§Errors
Returns SchemaError::MissingColumn when no column carries the name, or SchemaError::AmbiguousColumn when several do.
Sourcepub fn take_at(&mut self, index: usize) -> StdResult<CellValue, SchemaError>
pub fn take_at(&mut self, index: usize) -> StdResult<CellValue, SchemaError>
Move a value out of the row by zero-based column index, replacing the slot
with CellValue::Null.
§Errors
Returns SchemaError::InvalidColumnIndex when index is out of range for this row’s schema.
Sourcepub fn into_parts(self) -> (Arc<Schema>, Box<[CellValue]>)
pub fn into_parts(self) -> (Arc<Schema>, Box<[CellValue]>)
Consume the row, returning the shared schema and the decoded values in column order.
Sourcepub fn into_json_object(self) -> StdResult<Map<String, Value>, SchemaError>
pub fn into_json_object(self) -> StdResult<Map<String, Value>, SchemaError>
Consume the row into a serde_json::Map keyed by raw column label.
§Errors
Returns SchemaError::DuplicateColumnName when two columns share the same raw label — JSON object keys must be unique.
Trait Implementations§
Source§impl Clone for DynamicRow
impl Clone for DynamicRow
Source§fn clone(&self) -> DynamicRow
fn clone(&self) -> DynamicRow
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more