Enum chrono::Weekday [] [src]

pub enum Weekday {
    Mon,
    Tue,
    Wed,
    Thu,
    Fri,
    Sat,
    Sun,
}

The day of week (DOW).

The order of the days of week depends on the context. One should prefer *_from_monday or *_from_sunday methods to get the correct result.

Variants

Mon

Monday.

Tue

Tuesday.

Wed

Wednesday.

Thu

Thursday.

Fri

Friday.

Sat

Saturday.

Sun

Sunday.

Methods

impl Weekday

fn succ(&self) -> Weekday

The next day in the week.

fn pred(&self) -> Weekday

The previous day in the week.

fn number_from_monday(&self) -> u32

Returns a DOW number starting from Monday = 1. (ISO 8601 weekday number)

fn number_from_sunday(&self) -> u32

Returns a DOW number starting from Sunday = 1.

fn num_days_from_monday(&self) -> u32

Returns a DOW number starting from Monday = 0.

fn num_days_from_sunday(&self) -> u32

Returns a DOW number starting from Sunday = 0.

Trait Implementations

impl FromPrimitive for Weekday

Any weekday can be represented as an integer from 0 to 6, which equals to Weekday::num_days_from_monday in this implementation. Do not heavily depend on this though; use explicit methods whenever possible.

fn from_i64(n: i64) -> Option<Weekday>

fn from_u64(n: u64) -> Option<Weekday>

fn from_isize(n: isize) -> Option<Self>

fn from_i8(n: i8) -> Option<Self>

fn from_i16(n: i16) -> Option<Self>

fn from_i32(n: i32) -> Option<Self>

fn from_usize(n: usize) -> Option<Self>

fn from_u8(n: u8) -> Option<Self>

fn from_u16(n: u16) -> Option<Self>

fn from_u32(n: u32) -> Option<Self>

fn from_f32(n: f32) -> Option<Self>

fn from_f64(n: f64) -> Option<Self>

Derived Implementations

impl Debug for Weekday

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Clone for Weekday

fn clone(&self) -> Weekday

fn clone_from(&mut self, source: &Self)

impl Copy for Weekday

impl Eq for Weekday

impl PartialEq for Weekday

fn eq(&self, __arg_0: &Weekday) -> bool

fn ne(&self, __arg_0: &Weekday) -> bool