pub struct SimpleDate {
pub year: i32,
pub month: u32,
pub day: u32,
}Fields§
§year: i32§month: u32§day: u32Implementations§
Source§impl SimpleDate
impl SimpleDate
pub fn parse(input: &str) -> Option<Self>
pub fn days_until(self, other: Self) -> i64
pub fn add_days(self, days: i64) -> Self
pub fn from_days_since_unix_epoch(days: i64) -> Self
pub fn today_utc_approx() -> Self
Sourcepub fn has_passed_date_str(date: Option<&str>, today: Self) -> bool
pub fn has_passed_date_str(date: Option<&str>, today: Self) -> bool
true when date has arrived as of today — i.e. date <= today
(inclusive of the deadline day itself).
This is the deadline/expiry predicate used for expires and drain
windows. The boundary is inclusive: a deadline dated today has passed
(#2008 — a strict < previously enforced expiry one day late, letting
drain windows and entries live a day past their stated expiry). The
is_due_date_str review predicate uses the same inclusive boundary so
the two cannot drift.
Sourcepub fn is_due_date_str(date: Option<&str>, today: Self) -> bool
pub fn is_due_date_str(date: Option<&str>, today: Self) -> bool
true when date is due on or before today — i.e. date <= today
(inclusive). Used for review_after.
Trait Implementations§
Source§impl Clone for SimpleDate
impl Clone for SimpleDate
Source§fn clone(&self) -> SimpleDate
fn clone(&self) -> SimpleDate
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 SimpleDate
Source§impl Debug for SimpleDate
impl Debug for SimpleDate
Source§impl Display for SimpleDate
impl Display for SimpleDate
impl Eq for SimpleDate
Source§impl Ord for SimpleDate
impl Ord for SimpleDate
Source§fn cmp(&self, other: &SimpleDate) -> Ordering
fn cmp(&self, other: &SimpleDate) -> Ordering
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 PartialEq for SimpleDate
impl PartialEq for SimpleDate
Source§impl PartialOrd for SimpleDate
impl PartialOrd for SimpleDate
impl StructuralPartialEq for SimpleDate
Auto Trait Implementations§
impl Freeze for SimpleDate
impl RefUnwindSafe for SimpleDate
impl Send for SimpleDate
impl Sync for SimpleDate
impl Unpin for SimpleDate
impl UnsafeUnpin for SimpleDate
impl UnwindSafe for SimpleDate
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