pub struct ResultRow<'res: 'row, 'row> { /* private fields */ }Expand description
Access to columns of a row.
Implementations§
Source§impl<'res, 'row> ResultRow<'res, 'row>
Access to one row (step) of a result.
impl<'res, 'row> ResultRow<'res, 'row>
Access to one row (step) of a result.
Note “These routines attempt to convert the value where appropriate.”1
and “The value returned by sqlite3_column_type() is only
meaningful if no type conversions have occurred as described
below. After a type conversion, the value returned by
sqlite3_column_type() is undefined.”1
Sourcepub fn column_count(&self) -> ColIx
pub fn column_count(&self) -> ColIx
cf sqlite3_column_count
TODO: consider returning Option
Sourcepub fn with_column_name<T, F: Fn(&str) -> T>(
&mut self,
i: ColIx,
default: T,
f: F,
) -> T
pub fn with_column_name<T, F: Fn(&str) -> T>( &mut self, i: ColIx, default: T, f: F, ) -> T
Look up a column name and compute some function of it.
Return default if there is no column i
cf sqlite_column_name
Sourcepub fn column_type(&self, col: ColIx) -> ColumnType
pub fn column_type(&self, col: ColIx) -> ColumnType
Look up the type of a column.
Return SQLITE_NULL if there is no such col.
Sourcepub fn column_int(&self, col: ColIx) -> i32
pub fn column_int(&self, col: ColIx) -> i32
Get int value of a column.
Sourcepub fn column_int64(&self, col: ColIx) -> i64
pub fn column_int64(&self, col: ColIx) -> i64
Get int64 value of a column.
Sourcepub fn column_double(&self, col: ColIx) -> f64
pub fn column_double(&self, col: ColIx) -> f64
Get f64 (aka double) value of a column.
Sourcepub fn column_text(&self, col: ColIx) -> Option<String>
pub fn column_text(&self, col: ColIx) -> Option<String>
Get Option<String> (aka text) value of a column.
Sourcepub fn column_str<'a>(&'a self, col: ColIx) -> Option<&'a str>
pub fn column_str<'a>(&'a self, col: ColIx) -> Option<&'a str>
Get Option<&str> (aka text) value of a column.
Sourcepub fn column_blob(&self, col: ColIx) -> Option<Vec<u8>>
pub fn column_blob(&self, col: ColIx) -> Option<Vec<u8>>
Get Option<Vec<u8>> (aka blob) value of a column.
Sourcepub fn column_slice<'a>(&'a self, col: ColIx) -> Option<&'a [u8]>
pub fn column_slice<'a>(&'a self, col: ColIx) -> Option<&'a [u8]>
Get Option<&[u8]> (aka blob) value of a column.