Struct Statement

Source
pub struct Statement<'l> { /* private fields */ }
Expand description

A prepared statement.

Implementations§

Source§

impl<'l> Statement<'l>

Source

pub fn bind<T: Bindable>(&mut self, i: usize, value: T) -> Result<()>

Bind a value to a parameter.

The leftmost parameter has the index 1.

Source

pub fn columns(&self) -> usize

Return the number of columns.

Source

pub fn column_names(&self) -> Result<Vec<String>>

Return all the column names from the statement

Source

pub fn kind(&self, i: usize) -> Type

Return the type of a column.

The type is revealed after the first step has been taken.

Source

pub fn next(&mut self) -> Result<State>

Advance to the next state.

The function should be called multiple times until State::Done is reached in order to evaluate the statement entirely.

Source

pub fn read<T: Readable>(&self, i: usize) -> Result<T>

Read a value from a column.

The leftmost column has the index 0.

Source

pub fn reset(&mut self) -> Result<()>

Reset the statement.

Source

pub fn cursor(self) -> Cursor<'l>

Upgrade to a cursor.

Source

pub fn as_raw(&self) -> *mut sqlite3_stmt

Return the raw pointer.

Trait Implementations§

Source§

impl<'l> Drop for Statement<'l>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'l> Freeze for Statement<'l>

§

impl<'l> RefUnwindSafe for Statement<'l>

§

impl<'l> !Send for Statement<'l>

§

impl<'l> !Sync for Statement<'l>

§

impl<'l> Unpin for Statement<'l>

§

impl<'l> UnwindSafe for Statement<'l>

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.