Enum Month
#[repr(u8)]
pub enum Month
Months of the year.
Variants
-
January = 1 -
February = 2 -
March = 3 -
April = 4 -
May = 5 -
June = 6 -
July = 7 -
August = 8 -
September = 9 -
October = 10 -
November = 11 -
December = 12
Implementations
impl Month
const fn length(self, year: i32) -> u8Get the number of days in the month of a given year.
# use Month; assert_eq!;const fn previous(self) -> SelfGet the previous month.
# use Month; assert_eq!;const fn next(self) -> SelfGet the next month.
# use Month; assert_eq!;const fn nth_next(self, n: u8) -> SelfGet n-th next month.
# use Month; assert_eq!; assert_eq!;const fn nth_prev(self, n: u8) -> SelfGet n-th previous month.
# use Month; assert_eq!; assert_eq!;const fn iter_from(start: Self) -> MonthIterCreate an infinite iterator starting at this month.
# use Month; let mut iter = iter_from; assert_eq!; assert_eq!; assert_eq!; assert_eq!; assert_eq!; assert_eq!; assert_eq!; assert_eq!; assert_eq!; assert_eq!; assert_eq!; assert_eq!; assert_eq!; // … continuing forever
Trait Implementations
impl Clone for Month
fn clone(&self) -> Self
impl Copy for Month
impl Debug for Month
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Display for Month
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for Month
impl FromStr for Month
type Err = InvalidVariant;fn from_str(s: &str) -> Result<Self, Self::Err>
impl Hash for Month
fn hash<__H: Hasher>(&self, state: &mut __H)
impl Ord for Month
fn cmp(&self, other: &Self) -> Ordering
impl PartialEq for Month
fn eq(&self, other: &Self) -> bool
impl PartialOrd for Month
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
impl SmartDisplay for Month
type Metadata = ();fn metadata(&self, FormatterOptions) -> Metadata<'_, Self>fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl StructuralPartialEq for Month
impl TryFrom<u8> for Month
type Error = ComponentRange;fn try_from(value: u8) -> Result<Self, Self::Error>
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
impl<T> Any for Month
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Month
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Month
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Month
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Month
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Month
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T> ToString for Month
where
T: Display + ?Sized,
fn to_string(&self) -> String
impl<T, U> Into<U> for Month
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Month
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Month
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>