pub struct Stardate {
pub value: f64,
pub era: StardateEra,
}Expand description
A parsed stardate with its era.
Fields§
§value: f64§era: StardateEraImplementations§
Source§impl Stardate
impl Stardate
Sourcepub fn to_gregorian_year(&self) -> f64
pub fn to_gregorian_year(&self) -> f64
Convert stardate to approximate Gregorian year (OCS §12.1).
Sourcepub fn from_gregorian_year(year: f64, era: StardateEra) -> Self
pub fn from_gregorian_year(year: f64, era: StardateEra) -> Self
Convert a Gregorian year to the nearest stardate in the given era.
Trait Implementations§
impl Copy for Stardate
impl StructuralPartialEq for Stardate
Auto Trait Implementations§
impl Freeze for Stardate
impl RefUnwindSafe for Stardate
impl Send for Stardate
impl Sync for Stardate
impl Unpin for Stardate
impl UnsafeUnpin for Stardate
impl UnwindSafe for Stardate
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