Enum Weekday
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: Self) -> SelfGet the previous weekday.
# use Weekday; assert_eq!;const fn next(self: Self) -> SelfGet the next weekday.
# use Weekday; assert_eq!;const fn nth_next(self: Self, n: u8) -> SelfGet n-th next day.
# use Weekday; assert_eq!; assert_eq!;const fn nth_prev(self: Self, n: u8) -> SelfGet n-th previous day.
# use Weekday; assert_eq!; assert_eq!;const fn number_from_monday(self: Self) -> u8Get the one-indexed number of days from Monday.
# use Weekday; assert_eq!;const fn number_from_sunday(self: Self) -> u8Get the one-indexed number of days from Sunday.
# use Weekday; assert_eq!;const fn number_days_from_monday(self: Self) -> u8Get the zero-indexed number of days from Monday.
# use Weekday; assert_eq!;const fn number_days_from_sunday(self: Self) -> u8Get the zero-indexed number of days from Sunday.
# use Weekday; assert_eq!;
impl Clone for Weekday
fn clone(self: &Self) -> Weekday
impl Copy for Weekday
impl Debug for Weekday
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Display for Weekday
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Eq for Weekday
impl Freeze for Weekday
impl FromStr for Weekday
fn from_str(s: &str) -> Result<Self, <Self as >::Err>
impl Hash for Weekday
fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)
impl PartialEq for Weekday
fn eq(self: &Self, other: &Weekday) -> bool
impl RefUnwindSafe for Weekday
impl Send for Weekday
impl SmartDisplay for Weekday
fn metadata(self: &Self, _: FormatterOptions) -> Metadata<'_, Self>fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl StructuralPartialEq for Weekday
impl Sync for Weekday
impl Unpin for Weekday
impl UnsafeUnpin for Weekday
impl UnwindSafe for Weekday
impl<T> Any for Weekday
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Weekday
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Weekday
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for Weekday
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for Weekday
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Weekday
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T> ToString for Weekday
fn to_string(self: &Self) -> String
impl<T, U> Into for Weekday
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Weekday
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Weekday
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>