Expand description
Represents a direction, either absolute or orientation-dependent.
- Absolute directions are Up, Down, Left, and Right.
- Relative directions are Front and Back.
Variants
Abs(Absolute)
An absolute direction.
Rel(Relative)
A direction relative to the current orientation.
Implementations
sourceimpl Direction
impl Direction
sourcepub fn relative(self, orientation: Orientation) -> Option<Relative>
pub fn relative(self, orientation: Orientation) -> Option<Relative>
Returns the relative direction for the given orientation.
Some combination have no corresponding relative position. For example,
Direction::Abs(Up)
means nothing for Orientation::Horizontal
.
sourcepub fn absolute(self, orientation: Orientation) -> Absolute
pub fn absolute(self, orientation: Orientation) -> Absolute
Returns the absolute direction in the given orientation
.
Trait Implementations
impl Copy for Direction
impl Eq for Direction
impl StructuralEq for Direction
impl StructuralPartialEq for Direction
Auto Trait Implementations
impl RefUnwindSafe for Direction
impl Send for Direction
impl Sync for Direction
impl Unpin for Direction
impl UnwindSafe for Direction
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more