pub trait IntoStatement {
type Returning;
// Required method
fn into_statement(self) -> Statement<Self::Returning>;
}Expand description
Convert a value into a Statement.
This trait bridges query builders to Statement<T>. The
associated Returning type encodes what the
statement produces when executed:
| Builder | Returning |
|---|---|
[Query<M>] | List<M> |
[Delete<M>] | () |
[Association<M>] | List<M> |
| Create builders (generated) | M |
| Tuples of builders | (R1, R2, …) |
Vec<Q> / [Q; N] | List<Q::Returning> |
Tuples, Vec, and arrays batch multiple statements into a single
round-trip. Each sub-statement runs independently; the combined result is
a tuple or list of individual results.
Required Associated Types§
Required Methods§
Sourcefn into_statement(self) -> Statement<Self::Returning>
fn into_statement(self) -> Statement<Self::Returning>
Consume self and produce the Statement.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8> IntoStatement for (Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8)where
Q1: IntoStatement,
Q2: IntoStatement,
Q3: IntoStatement,
Q4: IntoStatement,
Q5: IntoStatement,
Q6: IntoStatement,
Q7: IntoStatement,
Q8: IntoStatement,
impl<Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8> IntoStatement for (Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8)where
Q1: IntoStatement,
Q2: IntoStatement,
Q3: IntoStatement,
Q4: IntoStatement,
Q5: IntoStatement,
Q6: IntoStatement,
Q7: IntoStatement,
Q8: IntoStatement,
type Returning = (<Q1 as IntoStatement>::Returning, <Q2 as IntoStatement>::Returning, <Q3 as IntoStatement>::Returning, <Q4 as IntoStatement>::Returning, <Q5 as IntoStatement>::Returning, <Q6 as IntoStatement>::Returning, <Q7 as IntoStatement>::Returning, <Q8 as IntoStatement>::Returning)
fn into_statement( self, ) -> Statement<<(Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8) as IntoStatement>::Returning>
Source§impl<Q1, Q2, Q3, Q4, Q5, Q6, Q7> IntoStatement for (Q1, Q2, Q3, Q4, Q5, Q6, Q7)where
Q1: IntoStatement,
Q2: IntoStatement,
Q3: IntoStatement,
Q4: IntoStatement,
Q5: IntoStatement,
Q6: IntoStatement,
Q7: IntoStatement,
impl<Q1, Q2, Q3, Q4, Q5, Q6, Q7> IntoStatement for (Q1, Q2, Q3, Q4, Q5, Q6, Q7)where
Q1: IntoStatement,
Q2: IntoStatement,
Q3: IntoStatement,
Q4: IntoStatement,
Q5: IntoStatement,
Q6: IntoStatement,
Q7: IntoStatement,
type Returning = (<Q1 as IntoStatement>::Returning, <Q2 as IntoStatement>::Returning, <Q3 as IntoStatement>::Returning, <Q4 as IntoStatement>::Returning, <Q5 as IntoStatement>::Returning, <Q6 as IntoStatement>::Returning, <Q7 as IntoStatement>::Returning)
fn into_statement( self, ) -> Statement<<(Q1, Q2, Q3, Q4, Q5, Q6, Q7) as IntoStatement>::Returning>
Source§impl<Q1, Q2, Q3, Q4, Q5, Q6> IntoStatement for (Q1, Q2, Q3, Q4, Q5, Q6)where
Q1: IntoStatement,
Q2: IntoStatement,
Q3: IntoStatement,
Q4: IntoStatement,
Q5: IntoStatement,
Q6: IntoStatement,
impl<Q1, Q2, Q3, Q4, Q5, Q6> IntoStatement for (Q1, Q2, Q3, Q4, Q5, Q6)where
Q1: IntoStatement,
Q2: IntoStatement,
Q3: IntoStatement,
Q4: IntoStatement,
Q5: IntoStatement,
Q6: IntoStatement,
type Returning = (<Q1 as IntoStatement>::Returning, <Q2 as IntoStatement>::Returning, <Q3 as IntoStatement>::Returning, <Q4 as IntoStatement>::Returning, <Q5 as IntoStatement>::Returning, <Q6 as IntoStatement>::Returning)
fn into_statement( self, ) -> Statement<<(Q1, Q2, Q3, Q4, Q5, Q6) as IntoStatement>::Returning>
Source§impl<Q1, Q2, Q3, Q4, Q5> IntoStatement for (Q1, Q2, Q3, Q4, Q5)where
Q1: IntoStatement,
Q2: IntoStatement,
Q3: IntoStatement,
Q4: IntoStatement,
Q5: IntoStatement,
impl<Q1, Q2, Q3, Q4, Q5> IntoStatement for (Q1, Q2, Q3, Q4, Q5)where
Q1: IntoStatement,
Q2: IntoStatement,
Q3: IntoStatement,
Q4: IntoStatement,
Q5: IntoStatement,
type Returning = (<Q1 as IntoStatement>::Returning, <Q2 as IntoStatement>::Returning, <Q3 as IntoStatement>::Returning, <Q4 as IntoStatement>::Returning, <Q5 as IntoStatement>::Returning)
fn into_statement( self, ) -> Statement<<(Q1, Q2, Q3, Q4, Q5) as IntoStatement>::Returning>
Source§impl<Q1, Q2, Q3, Q4> IntoStatement for (Q1, Q2, Q3, Q4)
impl<Q1, Q2, Q3, Q4> IntoStatement for (Q1, Q2, Q3, Q4)
type Returning = (<Q1 as IntoStatement>::Returning, <Q2 as IntoStatement>::Returning, <Q3 as IntoStatement>::Returning, <Q4 as IntoStatement>::Returning)
fn into_statement( self, ) -> Statement<<(Q1, Q2, Q3, Q4) as IntoStatement>::Returning>
Source§impl<Q1, Q2, Q3> IntoStatement for (Q1, Q2, Q3)
impl<Q1, Q2, Q3> IntoStatement for (Q1, Q2, Q3)
type Returning = (<Q1 as IntoStatement>::Returning, <Q2 as IntoStatement>::Returning, <Q3 as IntoStatement>::Returning)
fn into_statement(self) -> Statement<<(Q1, Q2, Q3) as IntoStatement>::Returning>
Source§impl<Q1, Q2> IntoStatement for (Q1, Q2)where
Q1: IntoStatement,
Q2: IntoStatement,
impl<Q1, Q2> IntoStatement for (Q1, Q2)where
Q1: IntoStatement,
Q2: IntoStatement,
type Returning = (<Q1 as IntoStatement>::Returning, <Q2 as IntoStatement>::Returning)
fn into_statement(self) -> Statement<<(Q1, Q2) as IntoStatement>::Returning>
Source§impl<Q, const N: usize> IntoStatement for [Q; N]where
Q: IntoStatement,
Dynamic batch via [Q; N]: fixed-size array of typed queries, returns List<Q::Output>.
impl<Q, const N: usize> IntoStatement for [Q; N]where
Q: IntoStatement,
Dynamic batch via [Q; N]: fixed-size array of typed queries, returns List<Q::Output>.
type Returning = List<<Q as IntoStatement>::Returning>
fn into_statement(self) -> Statement<<[Q; N] as IntoStatement>::Returning>
Source§impl<Q> IntoStatement for Vec<Q>where
Q: IntoStatement,
Dynamic batch via Vec<Q>: all queries have the same type, returns List<Q::Output>.
impl<Q> IntoStatement for Vec<Q>where
Q: IntoStatement,
Dynamic batch via Vec<Q>: all queries have the same type, returns List<Q::Output>.