Struct ResultRow

Source
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.

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

Source

pub fn column_count(&self) -> ColIx

cf sqlite3_column_count

TODO: consider returning Option “This routine returns 0 if pStmt is an SQL statement that does not return data (for example an UPDATE).”

Source

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

Source

pub fn column_type(&self, col: ColIx) -> ColumnType

Look up the type of a column.

Return SQLITE_NULL if there is no such col.

Source

pub fn column_int(&self, col: ColIx) -> i32

Get int value of a column.

Source

pub fn column_int64(&self, col: ColIx) -> i64

Get int64 value of a column.

Source

pub fn column_double(&self, col: ColIx) -> f64

Get f64 (aka double) value of a column.

Source

pub fn column_text(&self, col: ColIx) -> Option<String>

Get Option<String> (aka text) value of a column.

Source

pub fn column_str<'a>(&'a self, col: ColIx) -> Option<&'a str>

Get Option<&str> (aka text) value of a column.

Source

pub fn column_blob(&self, col: ColIx) -> Option<Vec<u8>>

Get Option<Vec<u8>> (aka blob) value of a column.

Source

pub fn column_slice<'a>(&'a self, col: ColIx) -> Option<&'a [u8]>

Get Option<&[u8]> (aka blob) value of a column.

Trait Implementations§

Source§

impl<'res, 'row> ResultRowAccess for ResultRow<'res, 'row>

Source§

fn get<I: RowIndex + Display + Clone, T: FromSql>(&mut self, idx: I) -> T

Get T type result value from idxth column of a row. Read more
Source§

fn get_opt<I: RowIndex + Display + Clone, T: FromSql>( &mut self, idx: I, ) -> SqliteResult<T>

Try to get T type result value from idxth column of a row.

Auto Trait Implementations§

§

impl<'res, 'row> Freeze for ResultRow<'res, 'row>

§

impl<'res, 'row> RefUnwindSafe for ResultRow<'res, 'row>

§

impl<'res, 'row> !Send for ResultRow<'res, 'row>

§

impl<'res, 'row> !Sync for ResultRow<'res, 'row>

§

impl<'res, 'row> Unpin for ResultRow<'res, 'row>

§

impl<'res, 'row> !UnwindSafe for ResultRow<'res, 'row>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.