Enum json_api::query::Direction [] [src]

pub enum Direction {
    Asc,
    Desc,
}

The direction of a sort instruction.

Variants

Ascending

Descending

Methods

impl Direction
[src]

[src]

Returns true if the direction is Asc.

Example

use json_api::query::Direction;

let direction = Direction::Desc;
assert_eq!(direction.is_asc(), false);

let direction = Direction::Asc;
assert_eq!(direction.is_asc(), true);

[src]

Returns true if the direction is Desc.

Example

use json_api::query::Direction;

let direction = Direction::Asc;
assert_eq!(direction.is_desc(), false);

let direction = Direction::Desc;
assert_eq!(direction.is_desc(), true);

[src]

Returns a cloned inverse of self.

Example

use json_api::query::Direction;

let asc = Direction::Asc;
let desc = Direction::Desc;

assert_eq!(asc.reverse(), desc);
assert_eq!(desc.reverse(), asc);

Trait Implementations

impl Clone for Direction
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Direction
[src]

impl Debug for Direction
[src]

[src]

Formats the value using the given formatter.

impl Eq for Direction
[src]

impl Hash for Direction
[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 Direction
[src]

[src]

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

1.0.0
[src]

This method tests for !=.

impl Neg for Direction
[src]

The resulting type after applying the - operator.

[src]

Performs the unary - operation.