pub enum Phase {
NewMoon,
WaxingCrescent,
FirstQuarter,
WaxingGibbous,
FullMoon,
WaningGibbous,
LastQuarter,
WaningCrescent,
}Expand description
The eight principal and intermediate phases of the Moon.
Variants§
NewMoon
🌑 The Moon appears completely dark.
WaxingCrescent
🌒 The Moon is less than half visible after the new moon and before the full moon.
FirstQuarter
🌓 The Moon is half visible after the new moon and before the full moon.
WaxingGibbous
🌔 The Moon is more than half visible after the new moon and before the full moon.
FullMoon
🌕 The Moon is fully visible.
WaningGibbous
🌖 The Moon is more than half visible after the full moon and before the new moon.
LastQuarter
🌗 The Moon is half visible after the full moon and before the new moon.
WaningCrescent
🌘 The Moon is less than half visible after the full moon and before the new moon.
Implementations§
Source§impl Phase
impl Phase
Sourcepub fn as_emoji(self) -> char
pub fn as_emoji(self) -> char
Returns the Unicode emoji representation of the moon phase.
assert_eq!(Phase::FullMoon.as_emoji(), '🌕');Sourcepub fn iter() -> Iter<'static, Phase>
pub fn iter() -> Iter<'static, Phase>
Views the eight moon phases as an iterator.
assert_eq!(Phase::iter().next(), Some(&Phase::NewMoon));
assert_eq!(Phase::iter().len(), 8);Sourcepub fn is_principal(self) -> bool
pub fn is_principal(self) -> bool
Returns true if the phase is one of the four principal phases.
assert_eq!(Phase::NewMoon.is_principal(), true);Trait Implementations§
Source§impl From<PrincipalPhase> for Phase
impl From<PrincipalPhase> for Phase
Source§fn from(phase: PrincipalPhase) -> Phase
fn from(phase: PrincipalPhase) -> Phase
Converts to this type from the input type.
impl Copy for Phase
impl Eq for Phase
impl StructuralPartialEq for Phase
Auto Trait Implementations§
impl Freeze for Phase
impl RefUnwindSafe for Phase
impl Send for Phase
impl Sync for Phase
impl Unpin for Phase
impl UnwindSafe for Phase
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