Struct json_api::query::Sort [] [src]

pub struct Sort {
    pub direction: Direction,
    pub field: Path,
    // some fields omitted
}

A single sort instruction containing a direction and field path.

Fields

The direction to sort by.

The name of the field to sort by.

Methods

impl Sort
[src]

[src]

Returns a new Sort.

[src]

Returns a cloned inverse of self.

Example

use json_api::query::{Direction, Sort};

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]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Sort
[src]

[src]

Formats the value using the given formatter.

impl Eq for Sort
[src]

impl Hash for Sort
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl PartialEq for Sort
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Display for Sort
[src]

[src]

Formats the value using the given formatter. Read more

impl FromStr for Sort
[src]

The associated error which can be returned from parsing.

[src]

Parses a string s to return a value of this type. Read more

impl Neg for Sort
[src]

The resulting type after applying the - operator.

[src]

Performs the unary - operation.

impl<'de> Deserialize<'de> for Sort
[src]

[src]

Deserialize this value from the given Serde deserializer. Read more

impl Serialize for Sort
[src]

[src]

Serialize this value into the given Serde serializer. Read more

impl Stringify for Sort
[src]

[src]

Returns the string representation of the give value as a byte vector. Read more

[src]

Returns the string representation of the given value. Read more