pub struct Row {
pub columns: Vec<String>,
pub values: Vec<Value>,
}Expand description
One result row. Carries the column names (shared across the result) plus the per-cell JSON values.
Fields§
§columns: Vec<String>Column names, in the order the adapter emitted them.
values: Vec<Value>Per-cell values, parallel to columns.
Implementations§
Source§impl Row
impl Row
Sourcepub fn get<I: RowIndex, T: DeserializeOwned>(
&self,
index: I,
) -> Result<T, DactylError>
pub fn get<I: RowIndex, T: DeserializeOwned>( &self, index: I, ) -> Result<T, DactylError>
Strict typed extraction via serde. Returns a Conversion error on
any type mismatch (e.g. reading an integer column as bool when the
stored JSON is 1 rather than true). For lenient portable shapes
use Self::get_bool / Self::get_int / Self::get_real /
Self::get_str / Self::get_json.
Missing column → DactylError::ColumnNotFound.
Sourcepub fn get_bool<I: RowIndex>(&self, index: I) -> Result<bool, DactylError>
pub fn get_bool<I: RowIndex>(&self, index: I) -> Result<bool, DactylError>
Lenient bool accessor: accepts true/false or 0/1 integer.
Sourcepub fn get_int<I: RowIndex>(&self, index: I) -> Result<i64, DactylError>
pub fn get_int<I: RowIndex>(&self, index: I) -> Result<i64, DactylError>
Lenient i64 accessor: accepts JSON integer.
Sourcepub fn get_real<I: RowIndex>(&self, index: I) -> Result<f64, DactylError>
pub fn get_real<I: RowIndex>(&self, index: I) -> Result<f64, DactylError>
Lenient f64 accessor: accepts JSON number.
Sourcepub fn get_str<I: RowIndex>(&self, index: I) -> Result<String, DactylError>
pub fn get_str<I: RowIndex>(&self, index: I) -> Result<String, DactylError>
Lenient String accessor: accepts JSON string.
Sourcepub fn get_json<I: RowIndex>(&self, index: I) -> Result<Value, DactylError>
pub fn get_json<I: RowIndex>(&self, index: I) -> Result<Value, DactylError>
Raw JSON value accessor at the given column.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Row
impl<'de> Deserialize<'de> for Row
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Row
impl RefUnwindSafe for Row
impl Send for Row
impl Sync for Row
impl Unpin for Row
impl UnsafeUnpin for Row
impl UnwindSafe for Row
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