pub enum Direction2D {
Left,
Up,
Right,
Down,
}
Expand description
Directions along the coordinate axes in two dimensions.
Variants§
Left
Positive x direction.
Up
Positive y direction.
Right
Negative x direction.
Down
Negative y direction.
Implementations§
Source§impl Direction2D
impl Direction2D
Sourcepub fn reversed(self) -> Direction2D
pub fn reversed(self) -> Direction2D
Get the opposite direction.
Sourcepub fn orientation(&self) -> Orientation2D
pub fn orientation(&self) -> Orientation2D
Get the orientation of this direction.
Trait Implementations§
Source§impl Clone for Direction2D
impl Clone for Direction2D
Source§fn clone(&self) -> Direction2D
fn clone(&self) -> Direction2D
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Direction2D
impl Debug for Direction2D
Source§impl<'de> Deserialize<'de> for Direction2D
impl<'de> Deserialize<'de> for Direction2D
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Direction2D, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Direction2D, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Direction2D> for Direction1D
impl From<Direction2D> for Direction1D
Source§fn from(d2: Direction2D) -> Direction1D
fn from(d2: Direction2D) -> Direction1D
Downcast 2D direction to 1D direction by preserving the sign.
Source§impl Hash for Direction2D
impl Hash for Direction2D
Source§impl Ord for Direction2D
impl Ord for Direction2D
Source§fn cmp(&self, other: &Direction2D) -> Ordering
fn cmp(&self, other: &Direction2D) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for Direction2D
impl PartialEq for Direction2D
Source§impl PartialOrd for Direction2D
impl PartialOrd for Direction2D
Source§impl Serialize for Direction2D
impl Serialize for Direction2D
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for Direction2D
impl Eq for Direction2D
impl StructuralPartialEq for Direction2D
Auto Trait Implementations§
impl Freeze for Direction2D
impl RefUnwindSafe for Direction2D
impl Send for Direction2D
impl Sync for Direction2D
impl Unpin for Direction2D
impl UnwindSafe for Direction2D
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more