1 use query_builder::AsQuery;
2 use query_source::Table;
3 
4 /// The `into_boxed` method
5 ///
6 /// This trait should not be relied on directly by most apps. Its behavior is
7 /// provided by [`QueryDsl`]. However, you may need a where clause on this trait
8 /// to call `into_boxed` from generic code.
9 ///
10 /// [`QueryDsl`]: ../trait.QueryDsl.html
11 pub trait BoxedDsl<'a, DB> {
12     /// The return type of `internal_into_boxed`
13     type Output;
14 
15     /// See the trait documentation.
internal_into_boxed(self) -> Self::Output16     fn internal_into_boxed(self) -> Self::Output;
17 }
18 
19 impl<'a, T, DB> BoxedDsl<'a, DB> for T
20 where
21     T: Table + AsQuery,
22     T::Query: BoxedDsl<'a, DB>,
23 {
24     type Output = <T::Query as BoxedDsl<'a, DB>>::Output;
25 
internal_into_boxed(self) -> Self::Output26     fn internal_into_boxed(self) -> Self::Output {
27         self.as_query().internal_into_boxed()
28     }
29 }
30