[−][src]Enum chrono::Weekday
The day of week.
The order of the days of week depends on the context.
(This is why this type does not implement PartialOrd or Ord traits.)
One should prefer *_from_monday or *_from_sunday methods to get the correct result.
Variants
MonMonday.
TueTuesday.
WedWednesday.
ThuThursday.
FriFriday.
SatSaturday.
SunSunday.
Methods
impl Weekday[src]
impl Weekdaypub fn succ(&self) -> Weekday[src]
pub fn succ(&self) -> WeekdayThe next day in the week.
w: | Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|---|
w.succ(): | Tue | Wed | Thu | Fri | Sat | Sun | Mon |
pub fn pred(&self) -> Weekday[src]
pub fn pred(&self) -> WeekdayThe previous day in the week.
w: | Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|---|
w.pred(): | Sun | Mon | Tue | Wed | Thu | Fri | Sat |
pub fn number_from_monday(&self) -> u32[src]
pub fn number_from_monday(&self) -> u32Returns a day-of-week number starting from Monday = 1. (ISO 8601 weekday number)
w: | Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|---|
w.number_from_monday(): | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
pub fn number_from_sunday(&self) -> u32[src]
pub fn number_from_sunday(&self) -> u32Returns a day-of-week number starting from Sunday = 1.
w: | Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|---|
w.number_from_sunday(): | 2 | 3 | 4 | 5 | 6 | 7 | 1 |
pub fn num_days_from_monday(&self) -> u32[src]
pub fn num_days_from_monday(&self) -> u32Returns a day-of-week number starting from Monday = 0.
w: | Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|---|
w.num_days_from_monday(): | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
pub fn num_days_from_sunday(&self) -> u32[src]
pub fn num_days_from_sunday(&self) -> u32Returns a day-of-week number starting from Sunday = 0.
w: | Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|---|
w.num_days_from_sunday(): | 1 | 2 | 3 | 4 | 5 | 6 | 0 |
Trait Implementations
impl Clone for Weekday[src]
impl Clone for Weekdayfn clone(&self) -> Weekday[src]
fn clone(&self) -> WeekdayReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Copy for Weekday[src]
impl Copy for Weekdayimpl Eq for Weekday[src]
impl Eq for Weekdayimpl PartialEq<Weekday> for Weekday[src]
impl PartialEq<Weekday> for Weekdayfn eq(&self, other: &Weekday) -> bool[src]
fn eq(&self, other: &Weekday) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl Debug for Weekday[src]
impl Debug for Weekdayfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl FromPrimitive for Weekday[src]
impl FromPrimitive for WeekdayAny 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_i64(n: i64) -> Option<Weekday>[src]
fn from_i64(n: i64) -> Option<Weekday>Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u64(n: u64) -> Option<Weekday>[src]
fn from_u64(n: u64) -> Option<Weekday>Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_isize(n: isize) -> Option<Self>[src]
fn from_isize(n: isize) -> Option<Self>Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more
fn from_i8(n: i8) -> Option<Self>[src]
fn from_i8(n: i8) -> Option<Self>Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i16(n: i16) -> Option<Self>[src]
fn from_i16(n: i16) -> Option<Self>Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i32(n: i32) -> Option<Self>[src]
fn from_i32(n: i32) -> Option<Self>Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i128(n: i128) -> Option<Self>[src]
fn from_i128(n: i128) -> Option<Self>Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_usize(n: usize) -> Option<Self>[src]
fn from_usize(n: usize) -> Option<Self>Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u8(n: u8) -> Option<Self>[src]
fn from_u8(n: u8) -> Option<Self>Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u16(n: u16) -> Option<Self>[src]
fn from_u16(n: u16) -> Option<Self>Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u32(n: u32) -> Option<Self>[src]
fn from_u32(n: u32) -> Option<Self>Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u128(n: u128) -> Option<Self>[src]
fn from_u128(n: u128) -> Option<Self>Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f32(n: f32) -> Option<Self>[src]
fn from_f32(n: f32) -> Option<Self>Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f64(n: f64) -> Option<Self>[src]
fn from_f64(n: f64) -> Option<Self>Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
impl Encodable for Weekday[src]
impl Encodable for Weekdayfn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>[src]
fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>Serialize a value using an Encoder.
impl Decodable for Weekday[src]
impl Decodable for WeekdayAuto Trait Implementations
Blanket Implementations
impl<T> From for T[src]
impl<T> From for Timpl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, type Owned = T
fn to_owned(&self) -> T[src]
fn to_owned(&self) -> TCreates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)[src]
fn clone_into(&self, target: &mut T)🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>try_from)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut TMutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>try_from)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeId🔬 This is a nightly-only experimental API. (get_type_id)
this method will likely be replaced by an associated static
Gets the TypeId of self. Read more