Trait Query

Source
pub trait Query<S>: Sized {
    type SqlPart;
    type Context1: Default;
    type Context2: Default;
    type Output;

    // Required methods
    fn build_sql_part_back(
        ctx: &mut Self::Context2,
        from: Self::SqlPart,
    ) -> String;
    fn build_query(
        ctx1: Self::Context1,
        f: impl FnOnce(&mut Self::Context2) -> String,
    ) -> (String, Self::Output);

    // Provided methods
    fn handle_where_item<T>(t: T, ctx: &mut Self::Context1) -> Self::SqlPart
       where T: WhereItem<S, Self> + 'static { ... }
    fn handle_accept<T>(t: T, ctx: &mut Self::Context1) -> Self::SqlPart
       where AcceptToSqlPart<T>: ToSqlPart<Self, S> { ... }
}

Required Associated Types§

Required Methods§

Source

fn build_sql_part_back(ctx: &mut Self::Context2, from: Self::SqlPart) -> String

Source

fn build_query( ctx1: Self::Context1, f: impl FnOnce(&mut Self::Context2) -> String, ) -> (String, Self::Output)

Provided Methods§

Source

fn handle_where_item<T>(t: T, ctx: &mut Self::Context1) -> Self::SqlPart
where T: WhereItem<S, Self> + 'static,

👎Deprecated: in favor of ToSqlPart
Source

fn handle_accept<T>(t: T, ctx: &mut Self::Context1) -> Self::SqlPart
where AcceptToSqlPart<T>: ToSqlPart<Self, S>,

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§