Trait kas::dir::Directional [−][src]
pub trait Directional: 'static + Copy + Debug {
type Flipped: Directional;
type Reversed: Directional;
fn flipped(self) -> Self::Flipped;
fn reversed(self) -> Self::Reversed;
fn as_direction(self) -> Direction;
fn is_vertical(self) -> bool { ... }
fn is_horizontal(self) -> bool { ... }
fn is_reversed(self) -> bool { ... }
}
Expand description
Associated Types
type Flipped: Directional
type Flipped: Directional
Direction flipped over diagonal (i.e. Down ↔ Right)
This allows compile-time selection of the flipped direction.
type Reversed: Directional
type Reversed: Directional
Direction reversed along axis (i.e. Left ↔ Right)
This allows compile-time selection of the reversed direction.
Required methods
fn as_direction(self) -> Direction
fn as_direction(self) -> Direction
Convert to the Direction
enum
Provided methods
fn is_vertical(self) -> bool
fn is_vertical(self) -> bool
Up or Down
fn is_horizontal(self) -> bool
fn is_horizontal(self) -> bool
Left or Right
fn is_reversed(self) -> bool
fn is_reversed(self) -> bool
Left or Up