pub trait DateExt: Sized {
// Required methods
fn unix_days(&self) -> i32;
fn from_unix_days(days: i32) -> Result<Self, Error>
where Self: Sized;
fn format_yyyy_mm_dd(&self) -> String;
fn parse_yyyy_mm_dd(value: &str) -> Result<Self, Error>;
// Provided method
fn unix_day0() -> Date { ... }
}Expand description
Extends a Date with additional methods
Required Methods§
Sourcefn from_unix_days(days: i32) -> Result<Self, Error>where
Self: Sized,
fn from_unix_days(days: i32) -> Result<Self, Error>where
Self: Sized,
From the number of days since the beginning of the UNIX period, returns the Date
Sourcefn format_yyyy_mm_dd(&self) -> String
fn format_yyyy_mm_dd(&self) -> String
Formats as YYYY-MM-DD
Sourcefn parse_yyyy_mm_dd(value: &str) -> Result<Self, Error>
fn parse_yyyy_mm_dd(value: &str) -> Result<Self, Error>
Parses from YYYY-MM-DD
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.