#[repr(u16)]pub enum Cardinal {
North = 0,
NorthEast = 45,
East = 90,
SouthEast = 135,
South = 180,
SouthWest = 225,
West = 270,
NorthWest = 315,
}
Variants§
North = 0
Northern Cardinal
NorthEast = 45
North Eastern Cardinal
East = 90
Eastern Cardinal
SouthEast = 135
South Eastern Cardinal
South = 180
Southern Cardinal
SouthWest = 225
South Western Cardinal
West = 270
Western Cardinal
NorthWest = 315
North Western Cardinal
Implementations§
Source§impl Cardinal
impl Cardinal
Sourcepub fn is_latitude(&self) -> bool
pub fn is_latitude(&self) -> bool
Returns True if Self matches a latitude cardinal
Sourcepub fn is_longitude(&self) -> bool
pub fn is_longitude(&self) -> bool
Returns True if Self matches a longitude cardinal
Sourcepub fn same_kind(&self, rhs: Self) -> bool
pub fn same_kind(&self, rhs: Self) -> bool
Returns True if Cardinal and rhs
represents
same kind of coordinates
Sourcepub fn is_northern(&self) -> bool
pub fn is_northern(&self) -> bool
Returns True if Self is a Northern cardinal
Sourcepub fn is_southern(&self) -> bool
pub fn is_southern(&self) -> bool
Returns True if Self is a Southern cardinal
Sourcepub fn is_eastern(&self) -> bool
pub fn is_eastern(&self) -> bool
Returns True if Self is an Eastern cardinal
Sourcepub fn is_western(&self) -> bool
pub fn is_western(&self) -> bool
Returns True if Self is a Western cardinal
Sourcepub fn is_sub_quadrant(&self) -> bool
pub fn is_sub_quadrant(&self) -> bool
Returns True if Self matches a subquadrant cardinal, like NE or SW
Sourcepub fn to_angle(&self) -> u16
pub fn to_angle(&self) -> u16
Returns compass angle (in D°) associated to Self, 0° being North Cardinal
Sourcepub fn from_angle(angle: u16) -> Cardinal
pub fn from_angle(angle: u16) -> Cardinal
Builds a Cardinal from given compass angle (in D°), 0° being North Cardinal
Trait Implementations§
impl Copy for Cardinal
impl Eq for Cardinal
impl StructuralPartialEq for Cardinal
Auto Trait Implementations§
impl Freeze for Cardinal
impl RefUnwindSafe for Cardinal
impl Send for Cardinal
impl Sync for Cardinal
impl Unpin for Cardinal
impl UnwindSafe for Cardinal
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more