#[repr(u8)]pub enum Month {
Jan = 1,
Feb = 2,
Mar = 3,
Apr = 4,
May = 5,
Jun = 6,
Jul = 7,
Aug = 8,
Sep = 9,
Oct = 10,
Nov = 11,
Dec = 12,
}Expand description
One of the twelve Gregorian months.
Variants§
Implementations§
Source§impl Month
impl Month
Sourcepub const fn new(value: u8) -> Result<Self, InvalidMonthError>
pub const fn new(value: u8) -> Result<Self, InvalidMonthError>
Creates a Month from a 1-based month number, returning an error if out of range.
Sourcepub const fn number(self) -> NonZero<u8>
pub const fn number(self) -> NonZero<u8>
Returns the month number of self, which lies in the range 1..=12.
Sourcepub fn iter() -> impl ExactSizeIterator<Item = Month>
pub fn iter() -> impl ExactSizeIterator<Item = Month>
Returns an iterator over all twelve months, starting from January.
Trait Implementations§
Source§impl Ord for Month
impl Ord for Month
Source§impl PartialOrd for Month
impl PartialOrd for Month
impl Copy for Month
impl Eq 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