Enum datetime::Weekday [] [src]

pub enum Weekday {
    Sunday,
    Monday,
    Tuesday,
    Wednesday,
    Thursday,
    Friday,
    Saturday,
}

A named day of the week.

Sunday is Day 0. This seems to be a North American thing? It’s pretty much an arbitrary choice, and as you can’t use the from_zero method, it won’t affect you at all. If you want to change it, the only thing that should be affected is LocalDate::days_to_weekday.

Variants

Methods

impl Weekday
[src]

[src]

Return the weekday based on a number, with Sunday as Day 0, Monday as Day 1, and so on.

use datetime::Weekday;
assert_eq!(Weekday::from_zero(4), Ok(Weekday::Thursday));
assert!(Weekday::from_zero(7).is_err());

[src]

Trait Implementations

impl PartialEq for Weekday
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl Eq for Weekday
[src]

impl Debug for Weekday
[src]

[src]

Formats the value using the given formatter.

impl Clone for Weekday
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Weekday
[src]