Skip to main content

ToParam

Trait ToParam 

Source
pub trait ToParam: Sealed {
    // Required method
    fn bind_param(self, stmt: &mut Statement, position: i32) -> Result<()>;
}
Expand description

Trait for types which can be passed into SQLite queries as parameters.

Required Methods§

Source

fn bind_param(self, stmt: &mut Statement, position: i32) -> Result<()>

Bind this value to the prepared Statement at the provided position.

Note: the position of a named parameter can be obtained using Statement::parameter_position.

Implementations on Foreign Types§

Source§

impl ToParam for bool

Source§

fn bind_param(self, stmt: &mut Statement, pos: i32) -> Result<()>

Source§

impl ToParam for f64

Source§

fn bind_param(self, stmt: &mut Statement, pos: i32) -> Result<()>

Source§

impl ToParam for i64

Source§

fn bind_param(self, stmt: &mut Statement, pos: i32) -> Result<()>

Source§

impl ToParam for ()

Source§

fn bind_param(self, stmt: &mut Statement, pos: i32) -> Result<()>

Source§

impl<'a> ToParam for &'a str

Source§

fn bind_param(self, stmt: &mut Statement, pos: i32) -> Result<()>

Source§

impl<'a> ToParam for &'a [u8]

Source§

fn bind_param(self, stmt: &mut Statement, pos: i32) -> Result<()>

Source§

impl<'a, const N: usize> ToParam for &'a [u8; N]

Source§

fn bind_param(self, stmt: &mut Statement, pos: i32) -> Result<()>

Source§

impl<K, V> ToParam for (K, V)
where K: Into<Vec<u8>>, V: ToParam,

Used to bind named parameters. Sets the parameter with the name at self.0 to the value at self.1.

Source§

fn bind_param(self, stmt: &mut Statement, _: i32) -> Result<()>

Source§

impl<T> ToParam for Option<T>
where T: ToParam,

Sets the parameter to the contained value or NULL.

Source§

fn bind_param(self, stmt: &mut Statement, pos: i32) -> Result<()>

Implementors§

Source§

impl ToParam for &mut ValueRef

Source§

impl ToParam for Value

Sets the parameter to a dynamically typed Value.

Source§

impl ToParam for Blob

Source§

impl<'a> ToParam for &'a ValueRef

Source§

impl<T: 'static> ToParam for PassedRef<T>

Sets the parameter to NULL with this value as an associated pointer.