pub struct Row { /* private fields */ }Expand description
A detached row of owned values in ordinal order with provider-supplied names.
Implementations§
Source§impl Row
impl Row
Sourcepub fn new(columns: Vec<(String, Value)>) -> Result<Self, DbError>
pub fn new(columns: Vec<(String, Value)>) -> Result<Self, DbError>
Creates a row from owned name/value pairs; duplicate names remain representable but name lookup is ambiguous.
§Errors
Returns InvalidArgument with a static reason if a cell contains a non-finite float.
Sourcepub fn get_ordinal<T: FromValue>(&self, ordinal: usize) -> Result<T, DbError>
pub fn get_ordinal<T: FromValue>(&self, ordinal: usize) -> Result<T, DbError>
Returns a cell by zero-based ordinal, distinguishing missing columns and null values.
§Errors
Returns Missing, Null, WrongType, or Overflow as appropriate.
Sourcepub fn get<T: FromValue>(&self, name: &str) -> Result<T, DbError>
pub fn get<T: FromValue>(&self, name: &str) -> Result<T, DbError>
Returns a cell by exact name; missing and duplicate names are decode errors.
§Errors
Returns Missing, Ambiguous, Null, WrongType, or Overflow as appropriate.
Sourcepub fn read_at<T: FromValue>(&self, ordinal: usize) -> Result<T, DbError>
pub fn read_at<T: FromValue>(&self, ordinal: usize) -> Result<T, DbError>
Reads a cell by zero-based ordinal with the same exact typing rules as
Row::get_ordinal.
§Errors
Returns Missing, Null, WrongType, or Overflow as appropriate.
Sourcepub fn value_at(&self, ordinal: usize) -> Result<Value, DbError>
pub fn value_at(&self, ordinal: usize) -> Result<Value, DbError>
Returns a cloned cell by zero-based ordinal, without typed conversion.
§Errors
Returns Missing when the ordinal is absent.
Sourcepub fn encoded_bytes(&self) -> Result<usize, DbError>
pub fn encoded_bytes(&self) -> Result<usize, DbError>
Returns the row’s portable byte cost: column-name UTF-8 bytes plus value payload bytes.
Payload accounting is Null = 0, Bool = 1, I64/F64 = 8, and text/bytes length.
Providers and buffering use the same rule so a limit means the same thing at every layer.
§Errors
Returns Overflow if the aggregate cannot be represented in usize.