pub enum PrincipalPhase {
NewMoon,
FirstQuarter,
FullMoon,
LastQuarter,
}Expand description
The four principal phases of the Moon.
Variants§
NewMoon
🌑 The Moon appears completely dark.
FirstQuarter
🌓 The Moon is half visible after the new moon and before the full moon.
FullMoon
🌕 The Moon is fully visible.
LastQuarter
🌗 The Moon is half visible after the full moon and before the new moon.
Implementations§
Source§impl PrincipalPhase
impl PrincipalPhase
Sourcepub fn as_emoji(self) -> char
pub fn as_emoji(self) -> char
Returns the Unicode emoji representation of the moon phase.
assert_eq!(PrincipalPhase::FullMoon.as_emoji(), '🌕');Sourcepub fn iter() -> Iter<'static, PrincipalPhase>
pub fn iter() -> Iter<'static, PrincipalPhase>
Views the four principal moon phases as an iterator.
assert_eq!(PrincipalPhase::iter().next(), Some(&PrincipalPhase::NewMoon));
assert_eq!(PrincipalPhase::iter().len(), 4);Trait Implementations§
Source§impl Clone for PrincipalPhase
impl Clone for PrincipalPhase
Source§fn clone(&self) -> PrincipalPhase
fn clone(&self) -> PrincipalPhase
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PrincipalPhase
Source§impl Debug for PrincipalPhase
impl Debug for PrincipalPhase
impl Eq for PrincipalPhase
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.
Source§impl Hash for PrincipalPhase
impl Hash for PrincipalPhase
Source§impl PartialEq for PrincipalPhase
impl PartialEq for PrincipalPhase
Source§fn eq(&self, other: &PrincipalPhase) -> bool
fn eq(&self, other: &PrincipalPhase) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PrincipalPhase
Auto Trait Implementations§
impl Freeze for PrincipalPhase
impl RefUnwindSafe for PrincipalPhase
impl Send for PrincipalPhase
impl Sync for PrincipalPhase
impl Unpin for PrincipalPhase
impl UnsafeUnpin for PrincipalPhase
impl UnwindSafe for PrincipalPhase
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