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
impl Weekday
[src]
impl Weekday
[src]pub fn previous(self) -> Self
[src]
pub fn previous(self) -> Self
[src]Get the previous weekday.
assert_eq!(Weekday::Tuesday.previous(), Weekday::Monday);
pub fn next(self) -> Self
[src]
pub fn next(self) -> Self
[src]Get the next weekday.
assert_eq!(Weekday::Monday.next(), Weekday::Tuesday);
pub const fn iso_weekday_number(self) -> u8
[src]
pub const fn iso_weekday_number(self) -> u8
[src]Get the ISO 8601 weekday number. Equivalent to
Weekday::number_from_monday
.
assert_eq!(Weekday::Monday.iso_weekday_number(), 1);
pub const fn number_from_monday(self) -> u8
[src]
pub const fn number_from_monday(self) -> u8
[src]Get the one-indexed number of days from Monday.
assert_eq!(Weekday::Monday.number_from_monday(), 1);
pub const fn number_from_sunday(self) -> u8
[src]
pub const fn number_from_sunday(self) -> u8
[src]Get the one-indexed number of days from Sunday.
assert_eq!(Weekday::Monday.number_from_sunday(), 2);
pub const fn number_days_from_monday(self) -> u8
[src]
pub const fn number_days_from_monday(self) -> u8
[src]Get the zero-indexed number of days from Monday.
assert_eq!(Weekday::Monday.number_days_from_monday(), 0);
pub const fn number_days_from_sunday(self) -> u8
[src]
pub const fn number_days_from_sunday(self) -> u8
[src]Get the zero-indexed number of days from Sunday.
assert_eq!(Weekday::Monday.number_days_from_sunday(), 1);
Trait Implementations
impl Copy for Weekday
[src]
impl Eq for Weekday
[src]
impl StructuralEq for Weekday
[src]
impl StructuralPartialEq for Weekday
[src]
Auto Trait Implementations
impl RefUnwindSafe for Weekday
impl Send for Weekday
impl Sync for Weekday
impl Unpin for Weekday
impl UnwindSafe for Weekday
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more