pub enum Weekday {
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday,
Sunday,
}
This is supported on crate feature
cookies
only.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);
Get the next weekday.
assert_eq!(Weekday::Monday.next(), Weekday::Tuesday);
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
Compare self to key
and return true
if they are equal.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more