toasty_core/stmt/
order_by.rs

1use super::OrderByExpr;
2
3#[derive(Debug, Clone, PartialEq)]
4pub struct OrderBy {
5    pub exprs: Vec<OrderByExpr>,
6}
7
8impl OrderBy {
9    /// Flips the direction of each [`OrderByExpr`] that makes up this [`OrderBy`].
10    pub fn reverse(&mut self) {
11        for expr in &mut self.exprs {
12            expr.reverse();
13        }
14    }
15}
16
17impl From<OrderByExpr> for OrderBy {
18    fn from(value: OrderByExpr) -> Self {
19        Self { exprs: vec![value] }
20    }
21}