[][src]Enum beehive::Direction

#[repr(u8)]pub enum Direction {
    YZ,
    XZ,
    XY,
    ZY,
    ZX,
    YX,
    UP,
    DOWN,
}

All hex directions in sequential order.

  • Starting from North-east in clockwise order in in pointy grids where +X = East and +Y = North-east.
  • Starting from North in clockwise order in in flat grids where +X = North-east and +Y = North.

Variants

YZ
XZ
XY
ZY
ZX
YX
UP
DOWN

Methods

impl Direction[src]

pub fn clockwise(self) -> Direction[src]

Returns the direction rotated "clockwise" around the W axis. UP and DOWN are returned unchanged.

pub fn counter_clockwise(self) -> Direction[src]

Returns the direction rotated "counter-clockwise" around the W axis. UP and DOWN are returned unchanged.

pub fn iter() -> Directions[src]

Returns an iterator through all Directions, including UP and DOWN.

pub fn iter_planar() -> PlanarDirections[src]

Returns an iterator through planar Directions, excluding UP and DOWN.

Trait Implementations

impl<T> Add<Direction> for Point<T> where
    T: Zero + One + Add + Neg<Output = T>, 
[src]

type Output = Point<T>

The resulting type after applying the + operator.

impl<T> Add<Direction> for PointAxial<T> where
    T: Zero + One + Add + Neg<Output = T>, 
[src]

type Output = PointAxial<T>

The resulting type after applying the + operator.

impl<T> Add<Direction> for Vector<T> where
    T: Zero + One + Add + Neg<Output = T>, 
[src]

type Output = Vector<T>

The resulting type after applying the + operator.

impl<T> Add<Direction> for VectorAxial<T> where
    T: Zero + One + Add + Neg<Output = T>, 
[src]

type Output = VectorAxial<T>

The resulting type after applying the + operator.

impl<T> AddAssign<Direction> for Point<T> where
    T: Zero + One + AddAssign<T> + Neg<Output = T>, 
[src]

impl<T> AddAssign<Direction> for PointAxial<T> where
    T: Zero + One + AddAssign<T> + Neg<Output = T>, 
[src]

impl<T> AddAssign<Direction> for Vector<T> where
    T: Zero + One + AddAssign<T> + Neg<Output = T>, 
[src]

impl<T> AddAssign<Direction> for VectorAxial<T> where
    T: Zero + One + AddAssign<T> + Neg<Output = T>, 
[src]

impl Clone for Direction[src]

impl Copy for Direction[src]

impl Debug for Direction[src]

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

impl Eq for Direction[src]

impl Hash for Direction[src]

impl<T> Index<Direction> for DirectionMap<T>[src]

type Output = T

The returned type after indexing.

impl<T> IndexMut<Direction> for DirectionMap<T>[src]

impl Neg for Direction[src]

type Output = Self

The resulting type after applying the - operator.

impl PartialEq<Direction> for Direction[src]

impl Serialize for Direction[src]

impl StructuralEq for Direction[src]

impl StructuralPartialEq for Direction[src]

impl<T> Sub<Direction> for Point<T> where
    T: Zero + One + Sub<Output = T> + Neg<Output = T>, 
[src]

type Output = Point<T>

The resulting type after applying the - operator.

impl<T> Sub<Direction> for PointAxial<T> where
    T: Zero + One + Sub<Output = T> + Neg<Output = T>, 
[src]

type Output = PointAxial<T>

The resulting type after applying the - operator.

impl<T> Sub<Direction> for Vector<T> where
    T: Zero + One + Sub<Output = T> + Neg<Output = T>, 
[src]

type Output = Vector<T>

The resulting type after applying the - operator.

impl<T> Sub<Direction> for VectorAxial<T> where
    T: Zero + One + Sub<Output = T> + Neg<Output = T>, 
[src]

type Output = VectorAxial<T>

The resulting type after applying the - operator.

impl<T> SubAssign<Direction> for Point<T> where
    T: Zero + One + SubAssign<T> + Neg<Output = T>, 
[src]

impl<T> SubAssign<Direction> for PointAxial<T> where
    T: Zero + One + SubAssign<T> + Neg<Output = T>, 
[src]

impl<T> SubAssign<Direction> for Vector<T> where
    T: Zero + One + SubAssign<T> + Neg<Output = T>, 
[src]

impl<T> SubAssign<Direction> for VectorAxial<T> where
    T: Zero + One + SubAssign<T> + Neg<Output = T>, 
[src]

impl TryFrom<u8> for Direction[src]

type Error = NotDirection

The type returned in the event of a conversion error.

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[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.