Struct Days

pub struct Days(/* private field */);

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

Trait Implementations

impl Clone for Days

fn clone(&self) -> Self

impl Copy for Days

impl Debug for Days

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

impl Eq for Days

impl Hash for Days

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

impl Ord for Days

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

impl PartialEq for Days

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

impl PartialOrd for Days

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

impl StructuralPartialEq for Days

Auto Trait Implementations

impl Freeze for Days

impl RefUnwindSafe for Days

impl Send for Days

impl Sync for Days

impl Unpin for Days

impl UnsafeUnpin for Days

impl UnwindSafe for Days

Blanket Implementations

impl<T> Any for Days where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Days where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Days where T: ?Sized,

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

impl<T> CloneToUninit for Days where T: Clone,

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

impl<T> From<T> for Days

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Days where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for Days where U: From<T>,

fn into(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<U> for Days where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for Days where U: TryFrom<T>,

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