pub struct DateComplete { /* private fields */ }Expand description
A structure to hold the date portion of a DateTime. It contains a valid date in the proleptic Gregorian calendar.
Implementations§
Source§impl DateComplete
impl DateComplete
Sourcepub fn to_chrono(&self) -> NaiveDate
Available on crate feature chrono only.
pub fn to_chrono(&self) -> NaiveDate
chrono only.Converts self to a chrono::NaiveDate
Source§impl DateComplete
impl DateComplete
Sourcepub fn from_ymd(year: i32, month: u32, day: u32) -> Self
pub fn from_ymd(year: i32, month: u32, day: u32) -> Self
Create a complete date. Panics if the date is invalid.
Trait Implementations§
Source§impl Clone for DateComplete
impl Clone for DateComplete
Source§fn clone(&self) -> DateComplete
fn clone(&self) -> DateComplete
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Datelike for DateComplete
Available on crate feature chrono only.Convenience chrono::Datelike implementation, which mostly relies on internal conversion to
chrono::NaiveDate.
impl Datelike for DateComplete
Available on crate feature
chrono only.Convenience chrono::Datelike implementation, which mostly relies on internal conversion to chrono::NaiveDate.
Source§fn year(&self) -> i32
fn year(&self) -> i32
Returns the year number in the calendar date.
Source§fn with_year(&self, year: i32) -> Option<Self>
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>
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>
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>
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>
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>
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>
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)
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
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§fn num_days_in_month(&self) -> u8
fn num_days_in_month(&self) -> u8
Get the length in days of the month
Source§impl Debug for DateComplete
impl Debug for DateComplete
Source§impl Display for DateComplete
impl Display for DateComplete
Source§impl From<NaiveDate> for DateComplete
Available on crate feature chrono only.Converts from chrono::NaiveDate.
impl From<NaiveDate> for DateComplete
Available on crate feature
chrono only.Converts from chrono::NaiveDate.
Source§impl Hash for DateComplete
impl Hash for DateComplete
Source§impl PartialEq for DateComplete
impl PartialEq for DateComplete
impl Copy for DateComplete
impl Eq for DateComplete
impl StructuralPartialEq for DateComplete
Auto Trait Implementations§
impl Freeze for DateComplete
impl RefUnwindSafe for DateComplete
impl Send for DateComplete
impl Sync for DateComplete
impl Unpin for DateComplete
impl UnwindSafe for DateComplete
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