pub enum Weekday {
Mon,
Tue,
Wed,
Thu,
Fri,
Sat,
Sun,
}Expand description
A day of the week, from Monday to Sunday (ISO 8601 convention: the week starts on Monday).
API aligned with chrono::Weekday: same variants, same methods.
Variants§
Implementations§
Source§impl Weekday
impl Weekday
Sourcepub const fn num_days_from_monday(&self) -> u32
pub const fn num_days_from_monday(&self) -> u32
Day number counting from Monday = 0.
Sourcepub const fn num_days_from_sunday(&self) -> u32
pub const fn num_days_from_sunday(&self) -> u32
Day number counting from Sunday = 0.
Sourcepub const fn number_from_monday(&self) -> u32
pub const fn number_from_monday(&self) -> u32
Day number counting from Monday = 1 (ISO 8601 convention).
Sourcepub const fn number_from_sunday(&self) -> u32
pub const fn number_from_sunday(&self) -> u32
Day number counting from Sunday = 1.
Sourcepub const fn days_since(&self, other: Weekday) -> u32
pub const fn days_since(&self, other: Weekday) -> u32
The number of days since the previous occurrence (or the same day, if
equal) of other. Always in 0..7.
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for Weekday
impl<'arbitrary> Arbitrary<'arbitrary> for Weekday
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§impl Archive for Weekday
impl Archive for Weekday
impl Copy for Weekday
Source§impl<'de> Deserialize<'de> for Weekday
impl<'de> Deserialize<'de> for Weekday
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for Weekday
Prints the 3-letter English abbreviation, like chrono::Weekday (e.g.
“Mon”, “Tue”), to stay compatible with the %a format specifier.
impl Display for Weekday
Prints the 3-letter English abbreviation, like chrono::Weekday (e.g.
“Mon”, “Tue”), to stay compatible with the %a format specifier.
impl Eq for Weekday
Source§impl FromIterator<Weekday> for WeekdaySet
impl FromIterator<Weekday> for WeekdaySet
Source§impl Ord for Weekday
impl Ord for Weekday
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq<ArchivedWeekday> for Weekday
impl PartialEq<ArchivedWeekday> for Weekday
Source§impl PartialEq<Weekday> for ArchivedWeekday
impl PartialEq<Weekday> for ArchivedWeekday
Source§impl PartialOrd for Weekday
impl PartialOrd for Weekday
Source§impl PartialOrd<ArchivedWeekday> for Weekday
impl PartialOrd<ArchivedWeekday> for Weekday
Source§impl PartialOrd<Weekday> for ArchivedWeekday
impl PartialOrd<Weekday> for ArchivedWeekday
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> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
The archived counterpart of this type. Unlike
Archive, it may be unsized. Read moreSource§type MetadataResolver = ()
type MetadataResolver = ()
The resolver for the metadata of this type. Read more
Source§unsafe fn resolve_metadata(
&self,
_: usize,
_: <T as ArchiveUnsized>::MetadataResolver,
_: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata,
)
unsafe fn resolve_metadata( &self, _: usize, _: <T as ArchiveUnsized>::MetadataResolver, _: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata, )
Creates the archived version of the metadata for this value at the given position and writes
it to the given output. Read more
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> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> Error for T
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.