diesel/query_dsl/
boxed_dsl.rs1use crate::dsl;
2use crate::expression::TypedExpressionType;
3use crate::expression::ValidGrouping;
4use crate::query_builder::AsQuery;
5use crate::query_builder::FromClause;
6use crate::query_builder::SelectStatement;
7use crate::query_source::Table;
8use crate::Expression;
9
10pub trait BoxedDsl<'a, DB> {
18 type Output;
20
21 fn internal_into_boxed(self) -> dsl::IntoBoxed<'a, Self, DB>;
23}
24
25impl<'a, T, DB> BoxedDsl<'a, DB> for T
26where
27 T: Table + AsQuery<Query = SelectStatement<FromClause<T>>>,
28 SelectStatement<FromClause<T>>: BoxedDsl<'a, DB>,
29 T::DefaultSelection: Expression<SqlType = T::SqlType> + ValidGrouping<()>,
30 T::SqlType: TypedExpressionType,
31{
32 type Output = dsl::IntoBoxed<'a, SelectStatement<FromClause<T>>, DB>;
33
34 fn internal_into_boxed(self) -> Self::Output {
35 self.as_query().internal_into_boxed()
36 }
37}