[][src]Enum rdcl_aoc_helpers::direction::Direction

pub enum Direction {
    Up,
    Down,
    Left,
    Right,
}

There are four cardinal directions: Up, down, left, and right. You can also think of these as north, south, west and east.

Variants

Up
Down
Left
Right

Implementations

impl Direction[src]

pub fn turn_left(&self) -> Direction[src]

Turn one step to the left.

pub fn turn_right(&self) -> Direction[src]

Turn one step to the right.

pub fn reverse(&self) -> Direction[src]

Reverse direction.

pub fn turn(&self, steps: isize) -> Direction[src]

Turn an arbitrary number of steps. Positive numbers turn to the left, negative numbers turn to the right.

Trait Implementations

impl CanTravel<(i64, i64)> for Direction[src]

impl CanTravel<(usize, usize)> for Direction[src]

impl Clone for Direction[src]

impl Copy for Direction[src]

impl Debug for Direction[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.