pub enum Month {
January,
February,
March,
April,
May,
June,
July,
August,
September,
October,
November,
December,
}Expand description
A calendar month, named rather than numbered so that an impossible month cannot be recorded.
Deliberately not #[non_exhaustive]: the Gregorian calendar has twelve
months, and is not expected to grow one.
Variants§
January
January.
February
February.
March
March.
April
April.
May
May.
June
June.
July
July.
August
August.
September
September.
October
October.
November
November.
December
December.
Implementations§
Source§impl Month
impl Month
Sourcepub fn name(self) -> &'static str
pub fn name(self) -> &'static str
The English month name, capitalised — the spelling APA uses in a date
element (2020, August 26).
Sourcepub fn number(self) -> u8
pub fn number(self) -> u8
The month number, 1 for January through 12 for December. Used for ordering, never for rendering.
Sourcepub fn from_number(number: u8) -> Option<Self>
pub fn from_number(number: u8) -> Option<Self>
Parse a month from its number, 1 through 12.
Trait Implementations§
impl Copy for Month
Source§impl<'de> Deserialize<'de> for Month
impl<'de> Deserialize<'de> for Month
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
impl Eq for Month
Source§impl Ord for Month
impl Ord for Month
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Month
impl PartialOrd for Month
impl StructuralPartialEq for Month
Auto Trait Implementations§
impl Freeze for Month
impl RefUnwindSafe for Month
impl Send for Month
impl Sync for Month
impl Unpin for Month
impl UnsafeUnpin for Month
impl UnwindSafe for Month
Blanket Implementations§
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.