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
This is supported on crate feature
quickcheck only.This is supported on crate feature
serde only.Deserialize this value from the given Serde deserializer. Read more
This is supported on crate feature
serde only.Auto Trait Implementations
impl RefUnwindSafe for Weekdayimpl UnwindSafe for WeekdayBlanket Implementations
Mutably borrows from an owned value. Read more