diesel/query_dsl/
order_dsl.rs1use crate::expression::Expression;
2use crate::query_source::Table;
3
4pub trait OrderDsl<Expr: Expression> {
12 type Output;
14
15 fn order(self, expr: Expr) -> Self::Output;
17}
18
19impl<T, Expr> OrderDsl<Expr> for T
20where
21 Expr: Expression,
22 T: Table,
23 T::Query: OrderDsl<Expr>,
24{
25 type Output = <T::Query as OrderDsl<Expr>>::Output;
26
27 fn order(self, expr: Expr) -> Self::Output {
28 self.as_query().order(expr)
29 }
30}
31
32pub trait ThenOrderDsl<Expr> {
40 type Output;
42
43 fn then_order_by(self, expr: Expr) -> Self::Output;
45}
46
47impl<T, Expr> ThenOrderDsl<Expr> for T
48where
49 Expr: Expression,
50 T: Table,
51 T::Query: ThenOrderDsl<Expr>,
52{
53 type Output = <T::Query as ThenOrderDsl<Expr>>::Output;
54
55 fn then_order_by(self, expr: Expr) -> Self::Output {
56 self.as_query().then_order_by(expr)
57 }
58}
59
60pub trait ValidOrderingForDistinct<D> {}