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