Skip to main content

Bind

Trait Bind 

Source
pub trait Bind {
    const COLUMNS: usize;

    // Required method
    fn bind(&self, binder: &mut Binder<'_, '_>) -> SqlResult<()>;

    // Provided method
    fn bind_to(&self, stmt: &mut Statement<'_>) -> SqlResult<()> { ... }
}

Required Associated Constants§

Required Methods§

Source

fn bind(&self, binder: &mut Binder<'_, '_>) -> SqlResult<()>

Provided Methods§

Source

fn bind_to(&self, stmt: &mut Statement<'_>) -> SqlResult<()>

Bind to the Statement’s parameters starting from the beginning

This method will always bind to the parameters starting from the first parameter, even if those parameters were already bound to by previous call of bind_to! So, unless you want to overwrite previously bound parameters, do not call this function multiple times on the same Statement. For instance, if you want to bind "Hello" and 123 to a statement, don’t do:

"Hello".bind_to(stmt)?;
123.bind_to(stmt)?; // Wrong: this overwrites the "Hello"

Instead, call it once with a tuple like so:

("Hello", 123).bind_to(stmt)?; // Correct: binds both "Hello" and 123

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P> Bind for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)
where A: Bind, B: Bind, C: Bind, D: Bind, E: Bind, F: Bind, G: Bind, H: Bind, I: Bind, J: Bind, K: Bind, L: Bind, M: Bind, N: Bind, O: Bind, P: Bind,

Source§

const COLUMNS: usize

Source§

fn bind(&self, binder: &mut Binder<'_, '_>) -> SqlResult<()>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> Bind for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)
where A: Bind, B: Bind, C: Bind, D: Bind, E: Bind, F: Bind, G: Bind, H: Bind, I: Bind, J: Bind, K: Bind, L: Bind, M: Bind, N: Bind, O: Bind,

Source§

const COLUMNS: usize

Source§

fn bind(&self, binder: &mut Binder<'_, '_>) -> SqlResult<()>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N> Bind for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)
where A: Bind, B: Bind, C: Bind, D: Bind, E: Bind, F: Bind, G: Bind, H: Bind, I: Bind, J: Bind, K: Bind, L: Bind, M: Bind, N: Bind,

Source§

const COLUMNS: usize

Source§

fn bind(&self, binder: &mut Binder<'_, '_>) -> SqlResult<()>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M> Bind for (A, B, C, D, E, F, G, H, I, J, K, L, M)
where A: Bind, B: Bind, C: Bind, D: Bind, E: Bind, F: Bind, G: Bind, H: Bind, I: Bind, J: Bind, K: Bind, L: Bind, M: Bind,

Source§

const COLUMNS: usize

Source§

fn bind(&self, binder: &mut Binder<'_, '_>) -> SqlResult<()>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L> Bind for (A, B, C, D, E, F, G, H, I, J, K, L)
where A: Bind, B: Bind, C: Bind, D: Bind, E: Bind, F: Bind, G: Bind, H: Bind, I: Bind, J: Bind, K: Bind, L: Bind,

Source§

const COLUMNS: usize

Source§

fn bind(&self, binder: &mut Binder<'_, '_>) -> SqlResult<()>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K> Bind for (A, B, C, D, E, F, G, H, I, J, K)
where A: Bind, B: Bind, C: Bind, D: Bind, E: Bind, F: Bind, G: Bind, H: Bind, I: Bind, J: Bind, K: Bind,

Source§

const COLUMNS: usize

Source§

fn bind(&self, binder: &mut Binder<'_, '_>) -> SqlResult<()>

Source§

impl<A, B, C, D, E, F, G, H, I, J> Bind for (A, B, C, D, E, F, G, H, I, J)
where A: Bind, B: Bind, C: Bind, D: Bind, E: Bind, F: Bind, G: Bind, H: Bind, I: Bind, J: Bind,

Source§

const COLUMNS: usize

Source§

fn bind(&self, binder: &mut Binder<'_, '_>) -> SqlResult<()>

Source§

impl<A, B, C, D, E, F, G, H, I> Bind for (A, B, C, D, E, F, G, H, I)
where A: Bind, B: Bind, C: Bind, D: Bind, E: Bind, F: Bind, G: Bind, H: Bind, I: Bind,

Source§

const COLUMNS: usize

Source§

fn bind(&self, binder: &mut Binder<'_, '_>) -> SqlResult<()>

Source§

impl<A, B, C, D, E, F, G, H> Bind for (A, B, C, D, E, F, G, H)
where A: Bind, B: Bind, C: Bind, D: Bind, E: Bind, F: Bind, G: Bind, H: Bind,

Source§

const COLUMNS: usize

Source§

fn bind(&self, binder: &mut Binder<'_, '_>) -> SqlResult<()>

Source§

impl<A, B, C, D, E, F, G> Bind for (A, B, C, D, E, F, G)
where A: Bind, B: Bind, C: Bind, D: Bind, E: Bind, F: Bind, G: Bind,

Source§

const COLUMNS: usize

Source§

fn bind(&self, binder: &mut Binder<'_, '_>) -> SqlResult<()>

Source§

impl<A, B, C, D, E, F> Bind for (A, B, C, D, E, F)
where A: Bind, B: Bind, C: Bind, D: Bind, E: Bind, F: Bind,

Source§

const COLUMNS: usize

Source§

fn bind(&self, binder: &mut Binder<'_, '_>) -> SqlResult<()>

Source§

impl<A, B, C, D, E> Bind for (A, B, C, D, E)
where A: Bind, B: Bind, C: Bind, D: Bind, E: Bind,

Source§

const COLUMNS: usize

Source§

fn bind(&self, binder: &mut Binder<'_, '_>) -> SqlResult<()>

Source§

impl<A, B, C, D> Bind for (A, B, C, D)
where A: Bind, B: Bind, C: Bind, D: Bind,

Source§

const COLUMNS: usize

Source§

fn bind(&self, binder: &mut Binder<'_, '_>) -> SqlResult<()>

Source§

impl<A, B, C> Bind for (A, B, C)
where A: Bind, B: Bind, C: Bind,

Source§

const COLUMNS: usize

Source§

fn bind(&self, binder: &mut Binder<'_, '_>) -> SqlResult<()>

Source§

impl<A, B> Bind for (A, B)
where A: Bind, B: Bind,

Source§

const COLUMNS: usize

Source§

fn bind(&self, binder: &mut Binder<'_, '_>) -> SqlResult<()>

Source§

impl<T: Bind> Bind for Option<T>

Source§

const COLUMNS: usize = T::COLUMNS

Source§

fn bind(&self, binder: &mut Binder<'_, '_>) -> SqlResult<()>

Implementors§

Source§

impl<T: Table + HasKey> Bind for &Ref<T>

Source§

const COLUMNS: usize = <T::Key>::COLUMNS

Source§

impl<T: Table + HasKey> Bind for Ref<T>

Source§

const COLUMNS: usize = <T::Key>::COLUMNS

Source§

impl<T: ToSql + ToSql2 + ?Sized> Bind for T