[−][src]Enum gridly::prelude::Rotation
The 4 cardinal rotations: None
(no rotation), Flip
,
Clockwise
, and Anticlockwise
. These rotations support basic
arithmetic operations with themselves (sums, multiplication by a factor,
etc) and can be applied to Direction
and Vector
.
Variants
No rotation (0°)
Rotate 90° clockwise
Rotate 180°
Rotate 90° anticlockwise
Implementations
impl Rotation
[src]
#[must_use]pub fn is_turn(self) -> bool
[src]
Check if a rotation is a turn; that is, if it is Clockwise
or
Anticlockwise
Example
use gridly::rotation::*; assert!(!Rotation::None.is_turn()); assert!(!Rotation::Flip.is_turn()); assert!(Clockwise.is_turn()); assert!(Anticlockwise.is_turn());
#[must_use]pub fn reverse(self) -> Self
[src]
Get the rotation in the opposite direction. Note that Rotation::None
and
Rotation::Flip
are their own opposites.
Example
use gridly::rotation::*; assert_eq!(Rotation::None.reverse(), Rotation::None); assert_eq!(Rotation::Flip.reverse(), Rotation::Flip); assert_eq!(Clockwise.reverse(), Anticlockwise); assert_eq!(Anticlockwise.reverse(), Clockwise);
Trait Implementations
impl Add<Rotation> for Rotation
[src]
type Output = Rotation
The resulting type after applying the +
operator.
#[must_use]fn add(self, rhs: Rotation) -> Rotation
[src]
impl AddAssign<Rotation> for Rotation
[src]
fn add_assign(&mut self, rhs: Rotation)
[src]
impl Clone for Rotation
[src]
impl Copy for Rotation
[src]
impl Debug for Rotation
[src]
impl Eq for Rotation
[src]
impl Hash for Rotation
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Mul<i16> for Rotation
[src]
type Output = Rotation
The resulting type after applying the *
operator.
#[must_use]fn mul(self, rhs: i16) -> Rotation
[src]
impl Mul<i32> for Rotation
[src]
type Output = Rotation
The resulting type after applying the *
operator.
#[must_use]fn mul(self, rhs: i32) -> Rotation
[src]
impl Mul<i64> for Rotation
[src]
type Output = Rotation
The resulting type after applying the *
operator.
#[must_use]fn mul(self, rhs: i64) -> Rotation
[src]
impl Mul<i8> for Rotation
[src]
type Output = Rotation
The resulting type after applying the *
operator.
#[must_use]fn mul(self, rhs: i8) -> Rotation
[src]
impl Mul<isize> for Rotation
[src]
type Output = Rotation
The resulting type after applying the *
operator.
#[must_use]fn mul(self, rhs: isize) -> Rotation
[src]
impl Mul<u16> for Rotation
[src]
type Output = Rotation
The resulting type after applying the *
operator.
#[must_use]fn mul(self, rhs: u16) -> Rotation
[src]
impl Mul<u32> for Rotation
[src]
type Output = Rotation
The resulting type after applying the *
operator.
#[must_use]fn mul(self, rhs: u32) -> Rotation
[src]
impl Mul<u64> for Rotation
[src]
type Output = Rotation
The resulting type after applying the *
operator.
#[must_use]fn mul(self, rhs: u64) -> Rotation
[src]
impl Mul<u8> for Rotation
[src]
type Output = Rotation
The resulting type after applying the *
operator.
#[must_use]fn mul(self, rhs: u8) -> Rotation
[src]
impl Mul<usize> for Rotation
[src]
type Output = Rotation
The resulting type after applying the *
operator.
#[must_use]fn mul(self, rhs: usize) -> Rotation
[src]
impl Neg for Rotation
[src]
type Output = Rotation
The resulting type after applying the -
operator.
#[must_use]fn neg(self) -> Self
[src]
impl PartialEq<Rotation> for Rotation
[src]
impl StructuralEq for Rotation
[src]
impl StructuralPartialEq for Rotation
[src]
impl Sub<Rotation> for Rotation
[src]
type Output = Rotation
The resulting type after applying the -
operator.
#[must_use]fn sub(self, rhs: Rotation) -> Rotation
[src]
impl SubAssign<Rotation> for Rotation
[src]
fn sub_assign(&mut self, rhs: Rotation)
[src]
impl<'a> Sum<&'a Rotation> for Rotation
[src]
impl Sum<Rotation> for Rotation
[src]
Auto Trait Implementations
impl RefUnwindSafe for Rotation
impl Send for Rotation
impl Sync for Rotation
impl Unpin for Rotation
impl UnwindSafe for Rotation
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,