pub enum Absolute {
Left,
Up,
Right,
Down,
None,
}
Expand description
Absolute direction (up, down, left, right).
Variants
Left
Left
Up
Up
Right
Right
Down
Down
None
No real direction.
Used when the “direction” is accross layers for instance.
Implementations
sourceimpl Absolute
impl Absolute
sourcepub fn relative(self, orientation: Orientation) -> Option<Relative>
pub fn relative(self, orientation: Orientation) -> Option<Relative>
Returns the relative direction for the given orientation.
Returns None
when the direction does not apply to the given
orientation (ex: Left
and Vertical
).
sourcepub fn split(self) -> (Orientation, Relative)
pub fn split(self) -> (Orientation, Relative)
Splits this absolute direction into an orientation and relative direction.
For example, Right
will give (Horizontal, Back)
.
Trait Implementations
sourceimpl PartialEq<Absolute> for Absolute
impl PartialEq<Absolute> for Absolute
impl Copy for Absolute
impl Eq for Absolute
impl StructuralEq for Absolute
impl StructuralPartialEq for Absolute
Auto Trait Implementations
impl RefUnwindSafe for Absolute
impl Send for Absolute
impl Sync for Absolute
impl Unpin for Absolute
impl UnwindSafe for Absolute
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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