Skip to main content

DateTimeParts

Trait DateTimeParts 

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

Source

fn year(&self) -> i32

Source

fn month(&self) -> u8

Source

fn day(&self) -> u8

Source

fn hour(&self) -> u8

Source

fn minute(&self) -> u8

Source

fn second(&self) -> u8

Source

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

fn year(&self) -> i32

Source§

fn month(&self) -> u8

Source§

fn day(&self) -> u8

Source§

fn hour(&self) -> u8

Source§

fn minute(&self) -> u8

Source§

fn second(&self) -> u8

Source§

fn nanosecond(&self) -> u32

Source§

impl DateTimeParts for NaiveDateTime

Available on crate feature chrono only.
Source§

fn year(&self) -> i32

Source§

fn month(&self) -> u8

Source§

fn day(&self) -> u8

Source§

fn hour(&self) -> u8

Source§

fn minute(&self) -> u8

Source§

fn second(&self) -> u8

Source§

fn nanosecond(&self) -> u32

Source§

impl DateTimeParts for OffsetDateTime

Available on crate feature time only.
Source§

fn year(&self) -> i32

Source§

fn month(&self) -> u8

Source§

fn day(&self) -> u8

Source§

fn hour(&self) -> u8

Source§

fn minute(&self) -> u8

Source§

fn second(&self) -> u8

Source§

fn nanosecond(&self) -> u32

Source§

impl DateTimeParts for PrimitiveDateTime

Available on crate feature time only.
Source§

fn year(&self) -> i32

Source§

fn month(&self) -> u8

Source§

fn day(&self) -> u8

Source§

fn hour(&self) -> u8

Source§

fn minute(&self) -> u8

Source§

fn second(&self) -> u8

Source§

fn nanosecond(&self) -> u32

Source§

impl DateTimeParts for UtcDateTime

Available on crate feature time only.
Source§

fn year(&self) -> i32

Source§

fn month(&self) -> u8

Source§

fn day(&self) -> u8

Source§

fn hour(&self) -> u8

Source§

fn minute(&self) -> u8

Source§

fn second(&self) -> u8

Source§

fn nanosecond(&self) -> u32

Source§

impl DateTimeParts for Zoned

Available on crate feature jiff only.
Source§

fn year(&self) -> i32

Source§

fn month(&self) -> u8

Source§

fn day(&self) -> u8

Source§

fn hour(&self) -> u8

Source§

fn minute(&self) -> u8

Source§

fn second(&self) -> u8

Source§

fn nanosecond(&self) -> u32

Source§

impl<Tz> DateTimeParts for DateTime<Tz>
where Tz: TimeZone, DateTime<Tz>: Ord,

Available on crate feature chrono only.
Source§

fn year(&self) -> i32

Source§

fn month(&self) -> u8

Source§

fn day(&self) -> u8

Source§

fn hour(&self) -> u8

Source§

fn minute(&self) -> u8

Source§

fn second(&self) -> u8

Source§

fn nanosecond(&self) -> u32

Implementors§