Skip to main content

Fetch

Trait Fetch 

Source
pub trait Fetch<'r> {
    // Required methods
    unsafe fn fetch_column<'c>(
        statement: &'r Statement<'c>,
        column: ColumnIndex,
    ) -> Self
       where 'c: 'r;
    unsafe fn fetch_value<'c>(value: &'r ValueRef<'c>) -> Self
       where 'c: 'r;
}
Expand description

A type that can be read via a sqlite3_column_* or sqlite3_value_* function.

Required Methods§

Source

unsafe fn fetch_column<'c>( statement: &'r Statement<'c>, column: ColumnIndex, ) -> Self
where 'c: 'r,

Fetch a column value from the statement.

§Safety

Callers are responsible for managing the ffi::Statement lifecycle, and ensuring the ColumnIndex is in bounds.

From the SQLite reference:

If the SQL statement does not currently point to a valid row, or if the column index is out of range, the result is undefined. These routines may only be called when the most recent call to sqlite3_step has returned SQLITE_ROW and neither sqlite3_reset nor sqlite3_finalize have been called subsequently.

If any of these routines are called after sqlite3_reset or sqlite3_finalize or after sqlite3_step has returned something other than SQLITE_ROW, results are undefined. If sqlite3_step or sqlite3_reset or sqlite3_finalize are called from a different thread while any of these routines are pending, then the results are undefined.

Source

unsafe fn fetch_value<'c>(value: &'r ValueRef<'c>) -> Self
where 'c: 'r,

Available on crate features functions or value only.

Unpack a dynamic value into this type.

§Safety

Callers are responsible for managing the ffi::ValueRef lifecycle.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'r> Fetch<'r> for f64

Source§

unsafe fn fetch_column<'c>( statement: &'r Statement<'c>, column: ColumnIndex, ) -> Self
where 'c: 'r,

Source§

unsafe fn fetch_value<'c>(value: &'r ValueRef<'c>) -> Self
where 'c: 'r,

Available on crate features functions or value only.
Source§

impl<'r> Fetch<'r> for i32

Source§

unsafe fn fetch_column<'c>( statement: &'r Statement<'c>, column: ColumnIndex, ) -> Self
where 'c: 'r,

Source§

unsafe fn fetch_value<'c>(value: &'r ValueRef<'c>) -> Self
where 'c: 'r,

Available on crate features functions or value only.
Source§

impl<'r> Fetch<'r> for i64

Source§

unsafe fn fetch_column<'c>( statement: &'r Statement<'c>, column: ColumnIndex, ) -> Self
where 'c: 'r,

Source§

unsafe fn fetch_value<'c>(value: &'r ValueRef<'c>) -> Self
where 'c: 'r,

Available on crate features functions or value only.
Source§

impl<'r, T> Fetch<'r> for Option<T>
where T: Fetch<'r>,

Source§

unsafe fn fetch_column<'c>( statement: &'r Statement<'c>, column: ColumnIndex, ) -> Self
where 'c: 'r,

Source§

unsafe fn fetch_value<'c>(value: &'r ValueRef<'c>) -> Self
where 'c: 'r,

Available on crate features functions or value only.

Implementors§

Source§

impl<'r> Fetch<'r> for Type

Source§

impl<'r> Fetch<'r> for Borrowed<'r, str>

Source§

impl<'r> Fetch<'r> for Borrowed<'r, [u8]>

Source§

impl<'r> Fetch<'r> for OpaqueValueRef<'r>

Available on crate feature value only.
Source§

impl<'r, T: Pointee> Fetch<'r> for Pointer<'r, T>

Available on crate feature value only.
Source§

impl<'r, T: Pointee> Fetch<'r> for PointerMut<'r, T>

Available on crate feature value only.