Enum time::Weekday [−][src]
pub enum Weekday { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, }
Expand description
Days of the week.
As order is dependent on context (Sunday could be either two days after or five days before
Friday), this type does not implement PartialOrd
or Ord
.
Variants
Implementations
Get the previous weekday.
assert_eq!(Weekday::Tuesday.previous(), Weekday::Monday);Run
Get the next weekday.
assert_eq!(Weekday::Monday.next(), Weekday::Tuesday);Run
Get the one-indexed number of days from Monday.
assert_eq!(Weekday::Monday.number_from_monday(), 1);Run
Get the one-indexed number of days from Sunday.
assert_eq!(Weekday::Monday.number_from_sunday(), 2);Run
Get the zero-indexed number of days from Monday.
assert_eq!(Weekday::Monday.number_days_from_monday(), 0);Run
Get the zero-indexed number of days from Sunday.
assert_eq!(Weekday::Monday.number_days_from_sunday(), 1);Run
Trait Implementations
Deserialize this value from the given Serde deserializer. Read more
Generate a random value of T
, using rng
as the source of randomness.
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
Auto Trait Implementations
impl RefUnwindSafe for Weekday
impl UnwindSafe for Weekday
Blanket Implementations
Mutably borrows from an owned value. Read more