#[repr(u8)]pub enum Weekday {
Monday = 0,
Tuesday = 1,
Wednesday = 2,
Thursday = 3,
Friday = 4,
Saturday = 5,
Sunday = 6,
}
Expand description
The days of the week.
Variants§
Monday = 0
The first day of the week, according to the ISO-8601 standard.
§Etymology
The name Monday comes from the Old English word “Monandæg”, which means “Moon’s day”.
Tuesday = 1
§Etymology
The name Tuesday comes from the Old English word “Tiwesdæg”, which means “Tiw’s day”. Tiw was an Anglo-Saxon god associated with war and combat.
Wednesday = 2
§Etymology
The name Wednesday comes from the Old English word “Wodnesdæg”, which means “Woden’s day”. Woden was the chief god in Norse mythology, associated with wisdom, war, and death.
Thursday = 3
§Etymology
The name Thursday comes from the Old English word “Þunresdæg”, which means “Thor’s day”. Thor was the Norse god of thunder and lightning.
Friday = 4
§Etymology
The name Friday comes from the Old English word “Frīgedæg”, which means “Frige’s day”. Frige was an Anglo-Saxon goddess associated with love, fertility, and domestic life.
Saturday = 5
§Etymology
The name Saturday comes from the Latin word “Saturni dies”, which means “Saturn’s day”. Saturn was the Roman god of agriculture and wealth.
Sunday = 6
§Etymology
The name Sunday comes from the Old English word “Sunandæg”, which means “Sun’s day”.
Implementations§
Source§impl Weekday
impl Weekday
Sourcepub const fn previous_nth(self, nth: usize) -> Weekday
pub const fn previous_nth(self, nth: usize) -> Weekday
Returns the previous nth
weekday.
Source§impl Weekday
§from Monday
impl Weekday
§from Monday
Sourcepub const fn number_from_monday(self) -> u8 ⓘ
pub const fn number_from_monday(self) -> u8 ⓘ
Returns the weekday number from Monday=1
to Sunday=7
.
Sourcepub const fn index_from_monday(self) -> usize ⓘ
pub const fn index_from_monday(self) -> usize ⓘ
Returns the weekday index from Monday=0
to Sunday=6
.
Sourcepub const fn from_monday_index_unchecked(index: usize) -> Self
pub const fn from_monday_index_unchecked(index: usize) -> Self
Source§impl Weekday
§from Sunday
impl Weekday
§from Sunday
Sourcepub const fn number_from_sunday(self) -> u8 ⓘ
pub const fn number_from_sunday(self) -> u8 ⓘ
Returns the weekday number from Sunday=1
to Monday=7
.
Sourcepub const fn index_from_sunday(self) -> usize ⓘ
pub const fn index_from_sunday(self) -> usize ⓘ
Returns the weekday index from Sunday=0
to Monday=6
.
Sourcepub const fn from_sunday_index_unchecked(index: usize) -> Self
pub const fn from_sunday_index_unchecked(index: usize) -> Self
Source§impl Weekday
§abbreviations & representations
impl Weekday
§abbreviations & representations
pub const Mon: Weekday = Weekday::Monday
pub const Tue: Weekday = Weekday::Tuesday
pub const Wed: Weekday = Weekday::Wednesday
pub const Thu: Weekday = Weekday::Thursday
pub const Fri: Weekday = Weekday::Friday
pub const Sat: Weekday = Weekday::Saturday
pub const Sun: Weekday = Weekday::Sunday
pub const MO: Weekday = Weekday::Monday
pub const TU: Weekday = Weekday::Tuesday
pub const WE: Weekday = Weekday::Wednesday
pub const TH: Weekday = Weekday::Thursday
pub const FR: Weekday = Weekday::Friday
pub const SA: Weekday = Weekday::Saturday
pub const SU: Weekday = Weekday::Sunday
pub const M: Weekday = Weekday::Monday
pub const T: Weekday = Weekday::Tuesday
pub const W: Weekday = Weekday::Wednesday
pub const H: Weekday = Weekday::Thursday
pub const F: Weekday = Weekday::Friday
pub const A: Weekday = Weekday::Saturday
pub const U: Weekday = Weekday::Sunday
Sourcepub fn abbr3(self) -> &'static str ⓘ
pub fn abbr3(self) -> &'static str ⓘ
Returns the 3-letter abbreviated weekday name, in ASCII, UpperCamelCase.
Sourcepub fn abbr2(self) -> &'static str ⓘ
pub fn abbr2(self) -> &'static str ⓘ
Returns the 2-letter abbreviated weekday name, in ASCII, UPPERCASE.
Sourcepub fn abbr1(self) -> &'static str ⓘ
pub fn abbr1(self) -> &'static str ⓘ
Returns the 1-letter abbreviated weekday name, in ASCII, UPPERCASE.
Sourcepub const fn emoji(self) -> char
pub const fn emoji(self) -> char
Returns the emoji associated to the weekday.
These are: 🌕, 🏹, 🧙, ⚡, 💕, 💰, 🌞.
Full Moon, Bow and Arrow, Mage, Lightning Bolt, Two Hearts, Money Bag, and Sun.
§Examples
assert_eq![Weekday::Thursday.emoji(), '⚡'];
Sourcepub const fn planet(self) -> char
pub const fn planet(self) -> char
Returns the char of the associated planet of Helenistic astrology.
These are: ☽, ♂, ☿, ♃, ♀, ♄, ☀.
§Examples
assert_eq![Weekday::Thursday.planet(), '♃'];
Sourcepub const fn planet_name(self) -> &'static str ⓘ
pub const fn planet_name(self) -> &'static str ⓘ
Returns the name of the associated planet of Helenistic astrology.
These are: Moon, Mars, Mercury, Jupiter, Venus, Saturn and Sun.
§Examples
assert_eq![Weekday::Thursday.planet_name(), "Jupiter"];
Trait Implementations§
Source§impl FromStr for Weekday
Returns a Weekday
from a string containing either the full weekday name,
or any of the weekday ASCII abbreviations.
impl FromStr for Weekday
Returns a Weekday
from a string containing either the full weekday name,
or any of the weekday ASCII abbreviations.
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§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> ByteSized for T
impl<T> ByteSized for T
Source§const BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Source§fn byte_align(&self) -> usize ⓘ
fn byte_align(&self) -> usize ⓘ
Source§fn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Source§impl<T, R> Chain<R> for Twhere
T: ?Sized,
impl<T, R> Chain<R> for Twhere
T: ?Sized,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> ExtAny for T
impl<T> ExtAny for T
Source§fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Source§impl<T> ExtMem for Twhere
T: ?Sized,
impl<T> ExtMem for Twhere
T: ?Sized,
Source§const NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Source§fn mem_align_of_val(&self) -> usize ⓘ
fn mem_align_of_val(&self) -> usize ⓘ
Source§fn mem_size_of_val(&self) -> usize ⓘ
fn mem_size_of_val(&self) -> usize ⓘ
Source§fn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true
if dropping values of this type matters. Read moreSource§fn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self
without running its destructor. Read moreSource§fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Source§unsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§fn mem_as_bytes(&self) -> &[u8] ⓘ
fn mem_as_bytes(&self) -> &[u8] ⓘ
unsafe_slice
only.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Hook for T
impl<T> Hook for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError> ⓘ
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError> ⓘ
§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out
indicating that a T
is niched.