Struct OrderByExpr
pub struct OrderByExpr {
pub expr: Expr,
pub order: Option<Direction>,
}Expand description
A single expression within an OrderBy clause, with an
optional sort direction.
When order is None, the database default direction is used (typically
ascending).
§Examples
ⓘ
use toasty_core::stmt::{OrderByExpr, Direction, Expr};
let expr = OrderByExpr {
expr: Expr::null(),
order: Some(Direction::Desc),
};Fields§
§expr: ExprThe expression to order by.
order: Option<Direction>The sort direction, or None for the database default.
Implementations§
§impl OrderByExpr
impl OrderByExpr
pub fn reverse(&mut self)
pub fn reverse(&mut self)
Flips the sort direction. Desc becomes default (ascending); default
and Asc become Asc (explicit ascending, since the default changed).
Trait Implementations§
§impl Clone for OrderByExpr
impl Clone for OrderByExpr
§fn clone(&self) -> OrderByExpr
fn clone(&self) -> OrderByExpr
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for OrderByExpr
impl Debug for OrderByExpr
§impl From<OrderByExpr> for OrderBy
impl From<OrderByExpr> for OrderBy
§fn from(value: OrderByExpr) -> OrderBy
fn from(value: OrderByExpr) -> OrderBy
Converts to this type from the input type.
§impl PartialEq for OrderByExpr
impl PartialEq for OrderByExpr
impl StructuralPartialEq for OrderByExpr
Auto Trait Implementations§
impl Freeze for OrderByExpr
impl RefUnwindSafe for OrderByExpr
impl Send for OrderByExpr
impl Sync for OrderByExpr
impl Unpin for OrderByExpr
impl UnwindSafe for OrderByExpr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more