pub enum Axis {
Y,
X,
}
Expand description
The axes of a plane.
Variants§
Implementations§
source§impl Axis
impl Axis
sourcepub const ALL: [Axis; 2] = _
pub const ALL: [Axis; 2] = _
List of all possible axes. Please note that this requires no heap-allocation and is very cheap.
sourcepub fn iter() -> Iter ⓘ
pub fn iter() -> Iter ⓘ
Iterator over all axes.
Examples
Note that these examples put the axes in a vector, but if you want an
array of axes, just use Axis::ALL
.
Default Order
use gardiz::axis::{self, Axis};
let axes: Vec<Axis> = Axis::iter().collect();
assert_eq!(vec![Axis::Y, Axis::X], axes);
Reverse Order
use gardiz::axis::{self, Axis};
let axes: Vec<Axis> = Axis::iter().rev().collect();
assert_eq!(vec![Axis::X, Axis::Y], axes);
Trait Implementations§
source§impl<'de> Deserialize<'de> for Axis
impl<'de> Deserialize<'de> for Axis
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for Axis
impl Ord for Axis
source§impl PartialEq<Axis> for Axis
impl PartialEq<Axis> for Axis
source§impl PartialOrd<Axis> for Axis
impl PartialOrd<Axis> for Axis
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more