pub struct DbRow {
pub values: Vec<DbValue>,
}Expand description
One result row: a positional list of column values.
Fields§
§values: Vec<DbValue>The row’s column values, in SELECT/column order.
Implementations§
Source§impl DbRow
impl DbRow
Sourcepub fn get_i64(&self, idx: usize) -> Result<i64, DbError>
pub fn get_i64(&self, idx: usize) -> Result<i64, DbError>
Read column idx as an i64. Errors if it is NULL, not an integer, or
out of bounds.
Sourcepub fn get_text(&self, idx: usize) -> Result<&str, DbError>
pub fn get_text(&self, idx: usize) -> Result<&str, DbError>
Read column idx as text. Errors if it is NULL, not text, or out of
bounds.
Sourcepub fn get_blob(&self, idx: usize) -> Result<&[u8], DbError>
pub fn get_blob(&self, idx: usize) -> Result<&[u8], DbError>
Read column idx as a byte blob. Errors if it is NULL, not a blob, or
out of bounds.
Sourcepub fn get_u64(&self, idx: usize) -> Result<u64, DbError>
pub fn get_u64(&self, idx: usize) -> Result<u64, DbError>
Read a column written via DbValue::from_u64: a stored integer that
must be non-negative. Mirrors the checked write so a u64 round-trips
through a signed column without a lossy as cast; a negative stored
value (corruption or a hand-edit) is rejected rather than wrapped to a
huge u64 that would jump the clock to the end of time.
Sourcepub fn get_optional_u64(&self, idx: usize) -> Result<Option<u64>, DbError>
pub fn get_optional_u64(&self, idx: usize) -> Result<Option<u64>, DbError>
Read an optional column written via DbValue::from_u64: a stored integer that
must be non-negative. Mirrors the checked write so a u64 round-trips
through a signed column without a lossy as cast; a negative stored
value (corruption or a hand-edit) is rejected rather than wrapped to a
huge u64 that would jump the clock to the end of time.
Sourcepub fn get_bool(&self, idx: usize) -> Result<bool, DbError>
pub fn get_bool(&self, idx: usize) -> Result<bool, DbError>
Read column idx as a bool — a stored integer, true iff nonzero.
Errors if it is NULL, not an integer, or out of bounds.
Sourcepub fn get_optional_i64(&self, idx: usize) -> Result<Option<i64>, DbError>
pub fn get_optional_i64(&self, idx: usize) -> Result<Option<i64>, DbError>
Read column idx as an optional i64: None when NULL. Errors if it
is not an integer or out of bounds.
Sourcepub fn get_optional_text(&self, idx: usize) -> Result<Option<&str>, DbError>
pub fn get_optional_text(&self, idx: usize) -> Result<Option<&str>, DbError>
Read column idx as optional text: None when NULL. Errors if it is
not text or out of bounds.
Sourcepub fn get_uuid(&self, idx: usize) -> Result<[u8; 16], DbError>
pub fn get_uuid(&self, idx: usize) -> Result<[u8; 16], DbError>
Read column idx as a 16-byte UUID, accepting either a native UUID
value or a 16-byte blob. Errors if it is NULL, a wrong-length blob,
another type, or out of bounds.