pub struct Sort { /* private fields */ }Expand description
One ?sort= key: a field, and its direction.
JSON:API spells descending with a leading -, so ?sort=-created,message
is “newest first, then by message”.
Implementations§
Source§impl Sort
impl Sort
Sourcepub fn field(&self) -> &str
pub fn field(&self) -> &str
The field to sort on, with the - stripped.
Not checked against the resource’s schema: sorting is storage’s to
interpret, and only storage knows which columns are indexed or
whether an attribute is even stored. Reject what you do not support
with ErrorCode::InvalidParameter.
Sourcepub fn descending(&self) -> bool
pub fn descending(&self) -> bool
Whether the key was written -field.
Trait Implementations§
impl Eq for Sort
impl StructuralPartialEq for Sort
Auto Trait Implementations§
impl Freeze for Sort
impl RefUnwindSafe for Sort
impl Send for Sort
impl Sync for Sort
impl Unpin for Sort
impl UnsafeUnpin for Sort
impl UnwindSafe for Sort
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