pub struct Days(/* private fields */);
Expand description
A duration in calendar days.
This is useful because when using Duration
it is possible
that adding Duration::days(1)
doesn’t increment the day value as expected due to it being a
fixed number of seconds. This difference applies only when dealing with DateTime<TimeZone>
data types
and in other cases Duration::days(n)
and Days::new(n)
are equivalent.
Implementations§
Trait Implementations§
source§impl Add<Days> for NaiveDateTime
impl Add<Days> for NaiveDateTime
source§impl PartialEq<Days> for Days
impl PartialEq<Days> for Days
source§impl PartialOrd<Days> for Days
impl PartialOrd<Days> for Days
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Sub<Days> for NaiveDateTime
impl Sub<Days> for NaiveDateTime
impl Copy for Days
impl Eq for Days
impl StructuralEq for Days
impl StructuralPartialEq for Days
Auto Trait Implementations§
impl RefUnwindSafe for Days
impl Send for Days
impl Sync for Days
impl Unpin for Days
impl UnwindSafe for Days
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