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);
This function is const fn
when using rustc >= 1.46.
Get the next weekday.
assert_eq!(Weekday::Monday.next(), Weekday::Tuesday);
This function is const fn
when using rustc >= 1.46.
Get the ISO 8601 weekday number. Equivalent to
Weekday::number_from_monday
.
assert_eq!(Weekday::Monday.iso_weekday_number(), 1);
Get the one-indexed number of days from Monday.
assert_eq!(Weekday::Monday.number_from_monday(), 1);
Get the one-indexed number of days from Sunday.
assert_eq!(Weekday::Monday.number_from_sunday(), 2);
Get the zero-indexed number of days from Monday.
assert_eq!(Weekday::Monday.number_days_from_monday(), 0);
Get the zero-indexed number of days from Sunday.
assert_eq!(Weekday::Monday.number_days_from_sunday(), 1);
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Weekday
impl UnwindSafe for Weekday
Blanket Implementations
Mutably borrows from an owned value. Read more