DateExt

Trait DateExt 

Source
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§

Source

fn unix_days(&self) -> i32

Returns the number of days since the beginning of the UNIX period

Source

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

Source

fn format_yyyy_mm_dd(&self) -> String

Formats as YYYY-MM-DD

Source

fn parse_yyyy_mm_dd(value: &str) -> Result<Self, Error>

Parses from YYYY-MM-DD

Provided Methods§

Source

fn unix_day0() -> Date

Returns the Date for the UNIX epoch start

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.

Implementors§