[−][src]Trait kas::prelude::Directional
Trait over directional types
This trait has a variable implementation, Direction
, and several fixed
implementations, Right
, Down
, Left
and Up
.
Using a generic <D: Directional>
allows compile-time substitution of
direction information when parametrised with fixed implementations.
Associated Types
type Flipped: Directional
Direction flipped over diagonal (i.e. Down ↔ Right)
This allows compile-time selection of the flipped direction.
Required methods
fn as_direction(self) -> Direction
Convert to the Direction
enum
Provided methods
fn is_vertical(self) -> bool
Up or Down
fn is_horizontal(self) -> bool
Left or Right
fn is_reversed(self) -> bool
Left or Up