diesel::query_builder

Trait BindCollector

Source
pub trait BindCollector<'a, DB: TypeMetadata>: Sized {
    type Buffer;

    // Required method
    fn push_bound_value<T, U>(
        &mut self,
        bind: &'a U,
        metadata_lookup: &mut DB::MetadataLookup,
    ) -> QueryResult<()>
       where DB: Backend + HasSqlType<T>,
             U: ToSql<T, DB> + ?Sized + 'a;

    // Provided method
    fn push_null_value(
        &mut self,
        _metadata: DB::TypeMetadata,
    ) -> QueryResult<()> { ... }
}
Expand description

A type which manages serializing bind parameters during query construction.

The only reason you would ever need to interact with this trait is if you are adding support for a new backend to Diesel. Plugins which are extending the query builder will use AstPass::push_bind_param instead.

Required Associated Types§

Source

type Buffer

The internal buffer type used by this bind collector

Required Methods§

Source

fn push_bound_value<T, U>( &mut self, bind: &'a U, metadata_lookup: &mut DB::MetadataLookup, ) -> QueryResult<()>
where DB: Backend + HasSqlType<T>, U: ToSql<T, DB> + ?Sized + 'a,

Serializes the given bind value, and collects the result.

Provided Methods§

Source

fn push_null_value(&mut self, _metadata: DB::TypeMetadata) -> QueryResult<()>

Available on crate feature i-implement-a-third-party-backend-and-opt-into-breaking-changes only.

Push a null value with the given type information onto the bind collector

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.

Implementors§

Source§

impl<'a, DB> BindCollector<'a, DB> for RawBytesBindCollector<DB>
where for<'b> DB: Backend<BindCollector<'b> = Self> + TypeMetadata,