pub trait DateTimeParts: Ord {
// Required methods
fn year(&self) -> i32;
fn month(&self) -> u8;
fn day(&self) -> u8;
fn hour(&self) -> u8;
fn minute(&self) -> u8;
fn second(&self) -> u8;
fn nanosecond(&self) -> u32;
}Expand description
A trait to expose the date and time fields used by this crate.
Required Methods§
fn year(&self) -> i32
fn month(&self) -> u8
fn day(&self) -> u8
fn hour(&self) -> u8
fn minute(&self) -> u8
fn second(&self) -> u8
fn nanosecond(&self) -> u32
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl DateTimeParts for DateTime
Available on crate feature jiff only.
impl DateTimeParts for DateTime
Available on crate feature
jiff only.Source§impl DateTimeParts for NaiveDateTime
Available on crate feature chrono only.
impl DateTimeParts for NaiveDateTime
Available on crate feature
chrono only.Source§impl DateTimeParts for OffsetDateTime
Available on crate feature time only.
impl DateTimeParts for OffsetDateTime
Available on crate feature
time only.Source§impl DateTimeParts for PrimitiveDateTime
Available on crate feature time only.
impl DateTimeParts for PrimitiveDateTime
Available on crate feature
time only.Source§impl DateTimeParts for UtcDateTime
Available on crate feature time only.
impl DateTimeParts for UtcDateTime
Available on crate feature
time only.Source§impl DateTimeParts for Zoned
Available on crate feature jiff only.
impl DateTimeParts for Zoned
Available on crate feature
jiff only.Source§impl<Tz> DateTimeParts for DateTime<Tz>
Available on crate feature chrono only.
impl<Tz> DateTimeParts for DateTime<Tz>
Available on crate feature
chrono only.