Struct db_dump::Date

source ·
pub struct Date<Tz> { /* private fields */ }
Expand description

Represents the range of local timestamps between midnight and the adjacent midnight in the given timezone.

Implementations§

source§

impl Date<Utc>

source

pub const fn from_ymd(year: i32, month: u32, day: u32) -> Self

Makes a new Date from the calendar date (year, month and day).

§Panics

Panics if the specified calendar day does not exist, on invalid values for month or day, or if year is out of range for Date.

source§

impl<Tz> Date<Tz>
where Tz: TimeZone,

source

pub const fn naive_utc(&self) -> NaiveDate

Trait Implementations§

source§

impl<Tz> Add<TimeDelta> for Date<Tz>
where Tz: TimeZone,

§

type Output = Date<Tz>

The resulting type after applying the + operator.
source§

fn add(self, delta: TimeDelta) -> Date<Tz>

Performs the + operation. Read more
source§

impl<Tz> AddAssign<TimeDelta> for Date<Tz>
where Tz: TimeZone,

source§

fn add_assign(&mut self, delta: TimeDelta)

Performs the += operation. Read more
source§

impl<Tz: Clone> Clone for Date<Tz>

source§

fn clone(&self) -> Date<Tz>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Tz> Datelike for Date<Tz>
where Tz: TimeZone,

source§

fn year(&self) -> i32

Returns the year number in the calendar date.
source§

fn month(&self) -> u32

Returns the month number starting from 1. Read more
source§

fn month0(&self) -> u32

Returns the month number starting from 0. Read more
source§

fn day(&self) -> u32

Returns the day of month starting from 1. Read more
source§

fn day0(&self) -> u32

Returns the day of month starting from 0. Read more
source§

fn ordinal(&self) -> u32

Returns the day of year starting from 1. Read more
source§

fn ordinal0(&self) -> u32

Returns the day of year starting from 0. Read more
source§

fn weekday(&self) -> Weekday

Returns the day of week.
source§

fn iso_week(&self) -> IsoWeek

Returns the ISO week.
source§

fn with_year(&self, year: i32) -> Option<Self>

Makes a new value with the year number changed, while keeping the same month and day. Read more
source§

fn with_month(&self, month: u32) -> Option<Self>

Makes a new value with the month number (starting from 1) changed. Read more
source§

fn with_month0(&self, month0: u32) -> Option<Self>

Makes a new value with the month number (starting from 0) changed. Read more
source§

fn with_day(&self, day: u32) -> Option<Self>

Makes a new value with the day of month (starting from 1) changed. Read more
source§

fn with_day0(&self, day0: u32) -> Option<Self>

Makes a new value with the day of month (starting from 0) changed. Read more
source§

fn with_ordinal(&self, ordinal: u32) -> Option<Self>

Makes a new value with the day of year (starting from 1) changed. Read more
source§

fn with_ordinal0(&self, ordinal0: u32) -> Option<Self>

Makes a new value with the day of year (starting from 0) changed. Read more
source§

fn year_ce(&self) -> (bool, u32)

Returns the absolute year number starting from 1 with a boolean flag, which is false when the year predates the epoch (BCE/BC) and true otherwise (CE/AD).
source§

fn num_days_from_ce(&self) -> i32

Counts the days in the proleptic Gregorian calendar, with January 1, Year 1 (CE) as day 1. Read more
source§

impl Debug for Date<Utc>

source§

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

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Date<Utc>

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Date<Utc>

source§

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

Formats the value using the given formatter. Read more
source§

impl From<Date<Utc>> for NaiveDate

source§

fn from(date: Date<Utc>) -> Self

Converts to this type from the input type.
source§

impl From<NaiveDate> for Date<Utc>

source§

fn from(date: NaiveDate) -> Self

Converts to this type from the input type.
source§

impl<Tz> Hash for Date<Tz>
where Tz: TimeZone,

source§

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

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<Tz> Ord for Date<Tz>
where Tz: TimeZone,

source§

fn cmp(&self, other: &Date<Tz>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<Tz, Tz2> PartialEq<Date<Tz2>> for Date<Tz>
where Tz: TimeZone, Tz2: TimeZone,

source§

fn eq(&self, other: &Date<Tz2>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Tz, Tz2> PartialOrd<Date<Tz2>> for Date<Tz>
where Tz: TimeZone, Tz2: TimeZone,

source§

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

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Tz> Sub<TimeDelta> for Date<Tz>
where Tz: TimeZone,

§

type Output = Date<Tz>

The resulting type after applying the - operator.
source§

fn sub(self, delta: TimeDelta) -> Date<Tz>

Performs the - operation. Read more
source§

impl<Tz> Sub for Date<Tz>
where Tz: TimeZone,

§

type Output = TimeDelta

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Date<Tz>) -> TimeDelta

Performs the - operation. Read more
source§

impl<Tz> SubAssign<TimeDelta> for Date<Tz>
where Tz: TimeZone,

source§

fn sub_assign(&mut self, delta: TimeDelta)

Performs the -= operation. Read more
source§

impl<Tz: Copy> Copy for Date<Tz>

source§

impl<Tz> Eq for Date<Tz>
where Tz: TimeZone,

Auto Trait Implementations§

§

impl<Tz> Freeze for Date<Tz>
where Tz: Freeze,

§

impl<Tz> RefUnwindSafe for Date<Tz>
where Tz: RefUnwindSafe,

§

impl<Tz> Send for Date<Tz>
where Tz: Send,

§

impl<Tz> Sync for Date<Tz>
where Tz: Sync,

§

impl<Tz> Unpin for Date<Tz>
where Tz: Unpin,

§

impl<Tz> UnwindSafe for Date<Tz>
where Tz: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

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

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,