Struct json_api::query::sort::Sort
[−]
[src]
pub struct Sort {
pub direction: Direction,
pub field: Path,
// some fields omitted
}Fields
direction: Direction
field: Path
Methods
impl Sort[src]
fn new(field: Path, direction: Direction) -> Self[src]
fn reverse(&self) -> Self[src]
Returns a cloned inverse of self.
Example
let chrono = Sort::new("created-at".parse()?, Direction::Asc); let latest = chrono.reverse(); assert_eq!(chrono.field, latest.field); assert_eq!(chrono.direction, Direction::Asc); assert_eq!(latest.direction, Direction::Desc);
Trait Implementations
impl Clone for Sort[src]
fn clone(&self) -> Sort[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Debug for Sort[src]
impl Eq for Sort[src]
impl Hash for Sort[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)[src]
Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher]. Read more
impl PartialEq for Sort[src]
fn eq(&self, __arg_0: &Sort) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &Sort) -> bool[src]
This method tests for !=.
impl Display for Sort[src]
fn fmt(&self, f: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl FromStr for Sort[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(value: &str) -> Result<Self, Self::Err>[src]
Parses a string s to return a value of this type. Read more
impl Neg for Sort[src]
type Output = Self
The resulting type after applying the - operator.
fn neg(self) -> Self::Output[src]
Performs the unary - operation.
impl<'de> Deserialize<'de> for Sort[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>, [src]
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more