Struct Days

struct Days(_)

A duration in calendar days.

This is useful because when using TimeDelta it is possible that adding TimeDelta::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 TimeDelta::days(n) and Days::new(n) are equivalent.

Implementations

impl Days

const fn new(num: u64) -> Self

Construct a new Days from a number of days

impl Clone for Days

fn clone(self: &Self) -> Days

impl Copy for Days

impl Debug for Days

fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result

impl Eq for Days

impl Freeze for Days

impl Hash for Days

fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)

impl Ord for Days

fn cmp(self: &Self, other: &Days) -> $crate::cmp::Ordering

impl PartialEq for Days

fn eq(self: &Self, other: &Days) -> bool

impl PartialOrd for Days

fn partial_cmp(self: &Self, other: &Days) -> $crate::option::Option<$crate::cmp::Ordering>

impl RefUnwindSafe for Days

impl Send for Days

impl StructuralPartialEq for Days

impl Sync for Days

impl Unpin for Days

impl UnwindSafe for Days

impl<T> Any for Days

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Days

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Days

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for Days

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for Days

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Days

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for Days

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Days

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Days

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>