pub trait LoadExt {
// Provided methods
fn load<'e, Idx, E: PgExecutor<'e>>(
&self,
executor: E,
) -> impl Future<Output = Result<Vec<<Self as RowQuery<Idx>>::Output>>>
where Self: RowQuery<Idx> { ... }
fn load_one<'e, Idx, E: PgExecutor<'e>>(
&self,
executor: E,
) -> impl Future<Output = Result<Option<<Self as RowQuery<Idx>>::Output>>>
where Self: RowQuery<Idx> { ... }
}Expand description
load for the rows, load_one for the first of them, and
ExecuteExt::execute where there are none to decode. One trait for
every row-producing builder keeps the terminal vocabulary tied to what a
statement yields rather than to which builder happens to be in hand.
Implemented for every builder, satisfiable by the ones that produce
rows: what a builder can’t do is then reported by RowQuery, which says
so, rather than by the method not existing — which rustc answers with a
list of unsatisfied bounds or, worse, by suggesting Iterator. Not a
blanket impl, since load/count/execute are names other traits in a
caller’s scope have too. A builder added here needs its three empty
impls, or its terminal goes back to reporting nothing.
Provided Methods§
fn load<'e, Idx, E: PgExecutor<'e>>(
&self,
executor: E,
) -> impl Future<Output = Result<Vec<<Self as RowQuery<Idx>>::Output>>>where
Self: RowQuery<Idx>,
fn load_one<'e, Idx, E: PgExecutor<'e>>(
&self,
executor: E,
) -> impl Future<Output = Result<Option<<Self as RowQuery<Idx>>::Output>>>where
Self: RowQuery<Idx>,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".