pub struct Date(/* private fields */);Expand description
Date (no time of day).
Implementations§
Source§impl Date
impl Date
Sourcepub fn try_from_ymd(y: i32, m: i32, d: i32) -> Result<Self, DateTimeError>
pub fn try_from_ymd(y: i32, m: i32, d: i32) -> Result<Self, DateTimeError>
Constructs Date from year, month and day.
Sourcepub fn add_days(self, days: i32) -> Result<Self, DateTimeError>
pub fn add_days(self, days: i32) -> Result<Self, DateTimeError>
Date adds days.
Sourcepub fn add_interval(self, span: Interval) -> Result<Timestamp, DateTimeError>
pub fn add_interval(self, span: Interval) -> Result<Timestamp, DateTimeError>
Date add Interval.
Sourcepub fn sub_interval(self, span: Interval) -> Result<Timestamp, DateTimeError>
pub fn sub_interval(self, span: Interval) -> Result<Timestamp, DateTimeError>
Date subtracts Interval.
Sourcepub fn try_from_str(
s: &str,
date_order: DateOrder,
) -> Result<Self, DateTimeError>
pub fn try_from_str( s: &str, date_order: DateOrder, ) -> Result<Self, DateTimeError>
Parses Date string.
Trait Implementations§
Source§impl DateTime for Date
impl DateTime for Date
Source§fn date_part(
&self,
ty: FieldType,
unit: DateUnit,
) -> Result<Option<f64>, DateTimeError>
fn date_part( &self, ty: FieldType, unit: DateUnit, ) -> Result<Option<f64>, DateTimeError>
Extracts specified field from Date.
Source§fn truncate(&self, ty: FieldType, unit: DateUnit) -> Result<Self, DateTimeError>
fn truncate(&self, ty: FieldType, unit: DateUnit) -> Result<Self, DateTimeError>
Truncates Date to specified units.
Source§fn is_infinite(&self) -> bool
fn is_infinite(&self) -> bool
Checks whether date time is infinite.
Source§impl Ord for Date
impl Ord for Date
Source§impl PartialOrd for Date
impl PartialOrd for Date
impl Copy for Date
impl Eq for Date
impl StructuralPartialEq for Date
Auto Trait Implementations§
impl Freeze for Date
impl RefUnwindSafe for Date
impl Send for Date
impl Sync for Date
impl Unpin for Date
impl UnwindSafe for Date
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