pub struct Moon {
pub julian_date: f64,
pub phase: f64,
pub age: f64,
pub illumination: f64,
pub distance: f64,
pub lunation: u16,
}
Expand description
Represents information about the moon, including its julian date, phase, age, illumination, distance, and lunation.
Fields§
§julian_date: f64
A continuous count of days and fractions since noon Universal Time on January 1, 4713 BC
phase: f64
Phase of the moon.
age: f64
Age of the moon.
illumination: f64
Illumination of the moon (0 to 1 where 1 is a full moon).
distance: f64
Distance of the moon in earth radii.
lunation: u16
Lunation number.
Implementations§
Source§impl Moon
impl Moon
pub fn new(time: SystemTime) -> Moon
Sourcepub fn distance_km(&self) -> f64
pub fn distance_km(&self) -> f64
Returns the distance of the moon in kilometers.
Sourcepub fn phase_name(&self) -> &'static str
pub fn phase_name(&self) -> &'static str
Returns the name of the moon phase.
Sourcepub fn phase_emoji(&self) -> &'static str
pub fn phase_emoji(&self) -> &'static str
Returns the emoji representation of the moon phase.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Moon
impl RefUnwindSafe for Moon
impl Send for Moon
impl Sync for Moon
impl Unpin for Moon
impl UnwindSafe for Moon
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