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
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
Implementations
Get the previous weekday.
assert_eq!(Weekday::Tuesday.previous(), Weekday::Monday);
RunGet the next weekday.
assert_eq!(Weekday::Monday.next(), Weekday::Tuesday);
RunGet the one-indexed number of days from Monday.
assert_eq!(Weekday::Monday.number_from_monday(), 1);
RunGet the one-indexed number of days from Sunday.
assert_eq!(Weekday::Monday.number_from_sunday(), 2);
RunGet the zero-indexed number of days from Monday.
assert_eq!(Weekday::Monday.number_days_from_monday(), 0);
RunGet the zero-indexed number of days from Sunday.
assert_eq!(Weekday::Monday.number_days_from_sunday(), 1);
RunTrait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Weekday
impl UnwindSafe for Weekday
Blanket Implementations
Mutably borrows from an owned value. Read more