Enum Weekday
#[repr(u8)]
pub enum Weekday
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
impl Weekday
const fn previous(self) -> SelfGet the previous weekday.
# use Weekday; assert_eq!;const fn next(self) -> SelfGet the next weekday.
# use Weekday; assert_eq!;const fn nth_next(self, n: u8) -> SelfGet n-th next day.
# use Weekday; assert_eq!; assert_eq!;const fn nth_prev(self, n: u8) -> SelfGet n-th previous day.
# use Weekday; assert_eq!; assert_eq!;const fn number_from_monday(self) -> u8Get the one-indexed number of days from Monday.
# use Weekday; assert_eq!;const fn number_from_sunday(self) -> u8Get the one-indexed number of days from Sunday.
# use Weekday; assert_eq!;const fn number_days_from_monday(self) -> u8Get the zero-indexed number of days from Monday.
# use Weekday; assert_eq!;const fn number_days_from_sunday(self) -> u8Get the zero-indexed number of days from Sunday.
# use Weekday; assert_eq!;const fn iter_from(start: Self) -> WeekdayIterCreate an infinite iterator starting at this weekday.
# use Weekday; let mut iter = iter_from; assert_eq!; assert_eq!; assert_eq!; assert_eq!; assert_eq!; assert_eq!; assert_eq!; assert_eq!; // … continuing forever
Trait Implementations
impl Clone for Weekday
fn clone(&self) -> Weekday
impl Copy for Weekday
impl Debug for Weekday
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Display for Weekday
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for Weekday
impl FromStr for Weekday
type Err = InvalidVariant;fn from_str(s: &str) -> Result<Self, Self::Err>
impl Hash for Weekday
fn hash<__H: Hasher>(&self, state: &mut __H)
impl PartialEq for Weekday
fn eq(&self, other: &Weekday) -> bool
impl SmartDisplay for Weekday
type Metadata = ();fn metadata(&self, FormatterOptions) -> Metadata<'_, Self>fn fmt(&self, f: &mut Formatter<'_>) -> Result
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
impl<T> Any for Weekday
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Weekday
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Weekday
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Weekday
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Weekday
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Weekday
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T> ToString for Weekday
where
T: Display + ?Sized,
fn to_string(&self) -> String
impl<T, U> Into<U> for Weekday
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Weekday
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Weekday
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>