The day of week.
The order of the days of week depends on the context.
(This is why this type does not implement
One should prefer
*_from_sunday methods to get the correct result.
The next day in the week.
The previous day in the week.
pub fn number_from_monday(&self) -> u32[src]
Returns a day-of-week number starting from Monday = 1. (ISO 8601 weekday number)
pub fn number_from_sunday(&self) -> u32[src]
Returns a day-of-week number starting from Sunday = 1.
pub fn num_days_from_monday(&self) -> u32[src]
Returns a day-of-week number starting from Monday = 0.
pub fn num_days_from_sunday(&self) -> u32[src]
Returns a day-of-week number starting from Sunday = 0.
impl FromPrimitive for Weekday[src]
Any weekday can be represented as an integer from 0 to 6, which equals to
Weekday::num_days_from_monday in this implementation.
Do not heavily depend on this though; use explicit methods whenever possible.
fn from_isize(n: isize) -> Option<Self>[src]
fn from_usize(n: usize) -> Option<Self>[src]
str into a
Weekday uses the format
use chrono::Weekday; assert_eq!("Sunday".parse::<Weekday>(), Ok(Weekday::Sun)); assert!("any day".parse::<Weekday>().is_err());
The parsing is case-insensitive.
Only the shortest form (e.g.
sun) and the longest form (e.g.
sunday) is accepted.
type Err = ParseWeekdayError
The associated error which can be returned from parsing.
fn hash_slice<H>(data: &[Self], state: &mut H) where1.3.0[src]
impl StructuralEq for Weekday[src]
impl StructuralPartialEq for Weekday[src]
Auto Trait Implementations
impl RefUnwindSafe for Weekday
impl UnwindSafe for Weekday
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)[src]
type Error = Infallible
The type returned in the event of a conversion error.