[−][src]Enum gregorian::Month
A month on the Gregorian calendar.
Variants
Implementations
impl Month
[src]
pub const fn new(month: u8) -> Result<Self, InvalidMonthNumber>
[src]
Create a new month from a month number.
The number must be in the range 1-12 (inclusive).
pub unsafe fn new_unchecked(month: u8) -> Self
[src]
Create a new month from a month number, without checking for validity.
Safety
The month number will be transmuted directly to Month
.
If the number is not a valid enum variant, this triggers undefined behaviour.
pub const fn to_number(self) -> u8
[src]
Get the month number in the range 1-12.
pub fn with_year(self, year: impl Into<Year>) -> YearMonth
[src]
Combine the month with a year to create a YearMonth
.
pub const fn wrapping_add(self, count: i8) -> Self
[src]
Add a number of months, wrapping back to January after December.
pub const fn wrapping_sub(self, count: i8) -> Self
[src]
Add a number of months, wrapping back to December after January.
pub const fn wrapping_next(self) -> Self
[src]
Get the next month, wrapping back to January after December.
pub const fn wrapping_prev(self) -> Self
[src]
Get the previous month, wrapping back to December after January.
Trait Implementations
impl Clone for Month
[src]
impl Copy for Month
[src]
impl Debug for Month
[src]
impl Display for Month
[src]
impl Eq for Month
[src]
impl From<Month> for u8
[src]
impl Hash for Month
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Month
[src]
fn cmp(&self, other: &Month) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Month> for Month
[src]
impl PartialEq<u8> for Month
[src]
impl PartialOrd<Month> for Month
[src]
fn partial_cmp(&self, other: &Month) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for Month
[src]
impl StructuralPartialEq for Month
[src]
impl TryFrom<u8> for Month
[src]
Auto Trait Implementations
impl RefUnwindSafe for Month
impl Send for Month
impl Sync for Month
impl Unpin for Month
impl UnwindSafe for Month
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,
fn borrow_mut(&mut self) -> &mut T
[src]
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.
fn to_owned(&self) -> T
[src]
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.
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>,