Enum cursive::direction::Direction [−][src]
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.
Methods
impl Direction
[src]
impl Direction
pub fn relative(self, orientation: Orientation) -> Option<Relative>
[src]
pub fn relative(self, orientation: Orientation) -> Option<Relative>
Returns the relative direction for the given orientation.
pub fn absolute(self, orientation: Orientation) -> Absolute
[src]
pub fn absolute(self, orientation: Orientation) -> Absolute
Returns the absolute direction in the given orientation
.
pub fn back() -> Self
[src]
pub fn back() -> Self
Shortcut to create Direction::Rel(Relative::Back)
pub fn front() -> Self
[src]
pub fn front() -> Self
Shortcut to create Direction::Rel(Relative::Front)
pub fn left() -> Self
[src]
pub fn left() -> Self
Shortcut to create Direction::Abs(Absolute::Left)
pub fn right() -> Self
[src]
pub fn right() -> Self
Shortcut to create Direction::Abs(Absolute::Right)
pub fn up() -> Self
[src]
pub fn up() -> Self
Shortcut to create Direction::Abs(Absolute::Up)
pub fn down() -> Self
[src]
pub fn down() -> Self
Shortcut to create Direction::Abs(Absolute::Down)
pub fn none() -> Self
[src]
pub fn none() -> Self
Shortcut to create Direction::Abs(Absolute::None)
Trait Implementations
impl Debug for Direction
[src]
impl Debug for Direction
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Direction
[src]
impl Clone for Direction
fn clone(&self) -> Direction
[src]
fn clone(&self) -> Direction
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Copy for Direction
[src]
impl Copy for Direction
impl PartialEq for Direction
[src]
impl PartialEq for Direction