Struct serde_with::chrono::Days
source · pub struct Days(_);
Available on crate feature
chrono
only.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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.