Enum time::Weekday [−][src]
pub enum Weekday { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, }
Days of the week.
As order is dependent on context (Sunday could be either two days after or five days before
Friday), this type does not implement PartialOrd
or Ord
.
Variants
Implementations
impl Weekday
[src]
pub const fn previous(self) -> Self
[src]
Get the previous weekday.
assert_eq!(Weekday::Tuesday.previous(), Weekday::Monday);Run
pub const fn next(self) -> Self
[src]
Get the next weekday.
assert_eq!(Weekday::Monday.next(), Weekday::Tuesday);Run
pub const fn number_from_monday(self) -> u8
[src]
Get the one-indexed number of days from Monday.
assert_eq!(Weekday::Monday.number_from_monday(), 1);Run
pub const fn number_from_sunday(self) -> u8
[src]
Get the one-indexed number of days from Sunday.
assert_eq!(Weekday::Monday.number_from_sunday(), 2);Run
pub const fn number_days_from_monday(self) -> u8
[src]
Get the zero-indexed number of days from Monday.
assert_eq!(Weekday::Monday.number_days_from_monday(), 0);Run
pub const fn number_days_from_sunday(self) -> u8
[src]
Get the zero-indexed number of days from Sunday.
assert_eq!(Weekday::Monday.number_days_from_sunday(), 1);Run
Trait Implementations
impl Arbitrary for Weekday
[src]
This is supported on crate feature
quickcheck
only.impl Clone for Weekday
[src]
impl Copy for Weekday
[src]
impl Debug for Weekday
[src]
impl<'a> Deserialize<'a> for Weekday
[src]
This is supported on crate feature
serde
only.fn deserialize<D: Deserializer<'a>>(deserializer: D) -> Result<Self, D::Error>
[src]
impl Display for Weekday
[src]
impl Eq for Weekday
[src]
impl Hash for Weekday
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Weekday> for Weekday
[src]
fn eq(&self, other: &Weekday) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn ne(&self, other: &Rhs) -> boolimpl Serialize for Weekday
[src]
This is supported on crate feature
serde
only.impl StructuralEq for Weekday
[src]
impl StructuralPartialEq for Weekday
[src]
Auto Trait Implementations
impl RefUnwindSafe for Weekday
impl Send for Weekday
impl Sync for Weekday
impl Unpin for Weekday
impl UnwindSafe for Weekday
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,