pub struct DayDate {
pub year: i32,
pub month: u8,
pub day: u8,
}Expand description
A civil (zoneless) calendar date, proleptic Gregorian. Ordered chronologically; Display and
DayDate::parse_iso speak ISO-8601 (YYYY-MM-DD).
Fields§
§year: i32§month: u8§day: u8Implementations§
Source§impl DayDate
impl DayDate
Sourcepub fn new(year: i32, month: u8, day: u8) -> Option<DayDate>
pub fn new(year: i32, month: u8, day: u8) -> Option<DayDate>
A validated date (month 1–12, day within the month, leap-aware); None otherwise.
Sourcepub fn today() -> DayDate
pub fn today() -> DayDate
Today’s date derived from the system clock in UTC (Day carries no time-zone database; an app that must roll the date at local midnight should compute it with its own zone source).
Sourcepub fn to_epoch_days(self) -> i64
pub fn to_epoch_days(self) -> i64
Days since 1970-01-01 (negative before). The numeric interchange form across native
boundaries (Event::Custom.num).
Sourcepub fn from_epoch_days(days: i64) -> DayDate
pub fn from_epoch_days(days: i64) -> DayDate
The date days after 1970-01-01 (inverse of DayDate::to_epoch_days).
Trait Implementations§
impl Copy for DayDate
impl Eq for DayDate
Source§impl Ord for DayDate
impl Ord for DayDate
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for DayDate
impl PartialOrd for DayDate
impl StructuralPartialEq for DayDate
Auto Trait Implementations§
impl Freeze for DayDate
impl RefUnwindSafe for DayDate
impl Send for DayDate
impl Sync for DayDate
impl Unpin for DayDate
impl UnsafeUnpin for DayDate
impl UnwindSafe for DayDate
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
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