#[repr(u8)]pub enum Weekday {
Mon = 1,
Tue = 2,
Wed = 3,
Thu = 4,
Fri = 5,
Sat = 6,
Sun = 7,
}Expand description
Day of the week starting from Monday = 1 (ISO 8601).
The ordinal value of 0 is not being used by common RTC chips. This place can be used to re-map Sunday to 0 in order to obtain a week starting from Sunday.
PartialOrd isn’t implemented on purpose because weekdays are usually used in a cyclic manner.
Variants§
Mon = 1
Monday.
Tue = 2
Tuesday.
Wed = 3
Wednesday.
Thu = 4
Thursday.
Fri = 5
Friday.
Sat = 6
Saturday.
Sun = 7
Sunday.
Implementations§
Source§impl Weekday
impl Weekday
Sourcepub fn num_days_from_monday(self) -> u8
pub fn num_days_from_monday(self) -> u8
Returns a day-of-week number starting from Monday = 0.
Sourcepub fn number_from_monday(self) -> u8
pub fn number_from_monday(self) -> u8
Returns a day-of-week number starting from Monday = 1.
Sourcepub fn num_days_from_sunday(self) -> u8
pub fn num_days_from_sunday(self) -> u8
Returns a day-of-week number starting from Sunday = 0.
Sourcepub fn number_from_sunday(self) -> u8
pub fn number_from_sunday(self) -> u8
Returns a day-of-week number starting from Sunday = 1.
Trait Implementations§
impl Copy for Weekday
impl Eq for Weekday
impl StructuralPartialEq for Weekday
Auto Trait Implementations§
impl Freeze for Weekday
impl RefUnwindSafe for Weekday
impl Send for Weekday
impl Sync for Weekday
impl Unpin for Weekday
impl UnsafeUnpin for Weekday
impl UnwindSafe for Weekday
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more