[−][src]Enum gridly::direction::Direction
The four cardinal directions (up, down, left, right).
Variants
Up
The negative row direction
Down
The positive row direction
Left
The negative column direction
Right
The positive column direction
Methods
impl Direction
[src]
pub fn sized_vec(self, length: isize) -> Vector
[src]
Return a vector with the given length in this direction
pub fn unit_vec(self) -> Vector
[src]
Return the unit vector in the given direction
pub fn is_vertical(self) -> bool
[src]
True if this is Up
or Down
pub fn is_horizontal(self) -> bool
[src]
True if this is Left
or Right
pub fn reverse(self) -> Direction
[src]
Reverse this direction (Up
-> Down
, etc)
pub fn clockwise(self) -> Direction
[src]
Rotate this direction clockwise
pub fn counter_clockwise(self) -> Direction
[src]
Rotate this direction counterclockwise
Trait Implementations
impl Clone for Direction
[src]
fn clone(&self) -> Direction
[src]
default fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for Direction
[src]
impl Copy for Direction
[src]
impl PartialEq<Direction> for Direction
[src]
fn eq(&self, other: &Direction) -> bool
[src]
#[must_use]
default fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl From<Direction> for Vector
[src]
Convert a Direction
into a unit vector pointing in that direction
impl Debug for Direction
[src]
impl Hash for Direction
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
default 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 Mul<isize> for Direction
[src]
type Output = Vector
The resulting type after applying the *
operator.
fn mul(self, amount: isize) -> Vector
[src]
impl Neg for Direction
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,