Trait QueryBindExt

Source
pub trait QueryBindExt<'q, DB: Database>: Sized {
    // Required method
    fn bind<T>(self, value: T) -> Self
       where T: 'q + Send + Encode<'q, DB> + Type<DB>;

    // Provided methods
    fn bind_with<T>(self, value: T, bind_fn: impl Fn(Self, T) -> Self) -> Self { ... }
    fn bind_multi<T>(self, values: impl IntoIterator<Item = T>) -> Self
       where T: 'q + Send + Encode<'q, DB> + Type<DB> { ... }
    fn bind_multi_with<T: 'q>(
        self,
        values: impl IntoIterator<Item = &'q T>,
        bind_fn: impl Fn(Self, &'q T) -> Self,
    ) -> Self { ... }
    fn bind_fields<T: Insertable<Database = DB>>(self, value: &'q T) -> Self { ... }
    fn bind_multi_fields<T: Insertable<Database = DB> + 'q>(
        self,
        values: impl IntoIterator<Item = &'q T>,
    ) -> Self { ... }
}

Required Methods§

Source

fn bind<T>(self, value: T) -> Self
where T: 'q + Send + Encode<'q, DB> + Type<DB>,

Provided Methods§

Source

fn bind_with<T>(self, value: T, bind_fn: impl Fn(Self, T) -> Self) -> Self

Source

fn bind_multi<T>(self, values: impl IntoIterator<Item = T>) -> Self
where T: 'q + Send + Encode<'q, DB> + Type<DB>,

Source

fn bind_multi_with<T: 'q>( self, values: impl IntoIterator<Item = &'q T>, bind_fn: impl Fn(Self, &'q T) -> Self, ) -> Self

Source

fn bind_fields<T: Insertable<Database = DB>>(self, value: &'q T) -> Self

Source

fn bind_multi_fields<T: Insertable<Database = DB> + 'q>( self, values: impl IntoIterator<Item = &'q T>, ) -> Self

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<'q, DB, O> QueryBindExt<'q, DB> for QueryAs<'q, DB, O, <DB as HasArguments<'q>>::Arguments>
where DB: Database,

Source§

fn bind<T>(self, value: T) -> Self
where T: 'q + Send + Encode<'q, DB> + Type<DB>,

Source§

impl<'q, DB, O> QueryBindExt<'q, DB> for QueryScalar<'q, DB, O, <DB as HasArguments<'q>>::Arguments>
where DB: Database,

Source§

fn bind<T>(self, value: T) -> Self
where T: 'q + Send + Encode<'q, DB> + Type<DB>,

Source§

impl<'q, DB: Database> QueryBindExt<'q, DB> for Query<'q, DB, <DB as HasArguments<'q>>::Arguments>

Source§

fn bind<T>(self, value: T) -> Self
where T: 'q + Send + Encode<'q, DB> + Type<DB>,

Implementors§