#[repr(i8)]pub enum Weekday {
Monday = 1,
Tuesday = 2,
Wednesday = 3,
Thursday = 4,
Friday = 5,
Saturday = 6,
Sunday = 7,
}
Expand description
A weekday in a 7-day week, according to ISO-8601.
The discriminant values correspond to ISO-8601 weekday numbers (Monday = 1, Sunday = 7).
§Examples
use icu::calendar::types::Weekday;
assert_eq!(1, Weekday::Monday as usize);
assert_eq!(7, Weekday::Sunday as usize);
Variants§
Implementations§
Source§impl Weekday
impl Weekday
Sourcepub fn from_days_since_sunday(input: isize) -> Weekday
pub fn from_days_since_sunday(input: isize) -> Weekday
Convert from an ISO-8601 weekday number to an Weekday
enum. 0 is automatically converted
to 7 (Sunday). If the number is out of range, it is interpreted modulo 7.
§Examples
use icu::calendar::types::Weekday;
assert_eq!(Weekday::Sunday, Weekday::from_days_since_sunday(0));
assert_eq!(Weekday::Monday, Weekday::from_days_since_sunday(1));
assert_eq!(Weekday::Sunday, Weekday::from_days_since_sunday(7));
assert_eq!(Weekday::Monday, Weekday::from_days_since_sunday(8));
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Weekday
impl<'de> Deserialize<'de> for Weekday
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Weekday, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Weekday, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<C, A, Z> GetField<Weekday> for ZonedDateTime<A, Z>where
C: Calendar,
A: AsCalendar<Calendar = C>,
impl<C, A, Z> GetField<Weekday> for ZonedDateTime<A, Z>where
C: Calendar,
A: AsCalendar<Calendar = C>,
Source§impl IntoOption<Weekday> for Weekday
impl IntoOption<Weekday> for Weekday
Source§fn into_option(self) -> Option<Weekday>
fn into_option(self) -> Option<Weekday>
Return
self
as an Option<T>
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more