pub trait DateLike: Datelike {
// Provided methods
fn extract_epoch(&self) -> i64 { ... }
fn extract_year(&self) -> i32 { ... }
fn millennium(&self) -> i32 { ... }
fn century(&self) -> i32 { ... }
fn decade(&self) -> i32 { ... }
fn iso_week_number(&self) -> u32 { ... }
fn day_of_week(&self) -> u32 { ... }
fn iso_day_of_week(&self) -> u32 { ... }
}Expand description
Common set of methods for date component.
Provided Methods§
fn extract_epoch(&self) -> i64
Sourcefn extract_year(&self) -> i32
fn extract_year(&self) -> i32
The year in SQL’s numbering, where 1 BC is year -1 and there is no
year 0. Chrono’s year uses astronomical numbering, where 1 BC is
year 0.
fn millennium(&self) -> i32
fn century(&self) -> i32
fn decade(&self) -> i32
Sourcefn iso_week_number(&self) -> u32
fn iso_week_number(&self) -> u32
Extract the iso week of the year
Note that because isoweeks are defined in terms of January 4th, Jan 1 is only in week 1 about half of the time
fn day_of_week(&self) -> u32
fn iso_day_of_week(&self) -> u32
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".