Skip to main content

Month

Enum Month 

Source
#[repr(u8)]
pub enum Month {
Show 13 variants March = 0, April = 1, May = 2, June = 3, July = 4, August = 5, September = 6, October = 7, November = 8, December = 9, January = 10, February = 11, Addenduary = 12,
}
Expand description

Represents a month on the SAC13 calendar.

Months are practically the same as in the Gregorian Calendar. They have the same names and order. The two main differences are that SAC13 starts its year with March (so March is the 1st month) and SAC13 has 13 months and this additional month is called “Addenduary” and placed after February.

Variants§

§

March = 0

§

April = 1

§

May = 2

§

June = 3

§

July = 4

§

August = 5

§

September = 6

§

October = 7

§

November = 8

§

December = 9

§

January = 10

§

February = 11

§

Addenduary = 12

Implementations§

Source§

impl Month

Source

pub const fn new(m: u8) -> Option<Self>

Month from its ordinal number (valid are 1-13, both inclusive).

Returns None for invalid ordinals.

Source

pub const fn ord(self) -> u8

The ordinal number of the month.

Note that those are different from the Gregorian Calendar.
March = 1, April = 2, … February = 12, Addenduary = 13

Source

pub const fn add(self, rhs: u8) -> Self

Returns the next months. Effectively like calling Month::next rhs times.

.add(0) return the current month, .add(1) the next month, .add(2) the one after that, and so on.

Source

pub const fn sub(self, rhs: u8) -> Self

Returns the previous months. Effectively like calling Month::previous rhs times.

.sub(0) return the current month, .sub(1) the previous month, .sub(2) the one before that, and so on.

Source

pub const fn next(self) -> Self

Returns the next month (including over year boundries).

Source

pub const fn previous(self) -> Self

Returns the previous month (including over year boundries).

Source

pub const fn name(self) -> &'static str

Full name of the month (international, English).

March, April, May, …

Trait Implementations§

Source§

impl Add<i128> for Month

Source§

type Output = Month

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i128) -> Month

Performs the + operation. Read more
Source§

impl Add<i16> for Month

Source§

type Output = Month

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i16) -> Month

Performs the + operation. Read more
Source§

impl Add<i32> for Month

Source§

type Output = Month

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i32) -> Month

Performs the + operation. Read more
Source§

impl Add<i64> for Month

Source§

type Output = Month

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i64) -> Month

Performs the + operation. Read more
Source§

impl Add<i8> for Month

Source§

type Output = Month

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i8) -> Month

Performs the + operation. Read more
Source§

impl Add<u128> for Month

Source§

type Output = Month

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u128) -> Month

Performs the + operation. Read more
Source§

impl Add<u16> for Month

Source§

type Output = Month

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u16) -> Month

Performs the + operation. Read more
Source§

impl Add<u32> for Month

Source§

type Output = Month

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u32) -> Month

Performs the + operation. Read more
Source§

impl Add<u64> for Month

Source§

type Output = Month

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u64) -> Month

Performs the + operation. Read more
Source§

impl Add<u8> for Month

Source§

type Output = Month

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u8) -> Month

Performs the + operation. Read more
Source§

impl Clone for Month

Source§

fn clone(&self) -> Month

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Month

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Month

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Month> for i128

Source§

fn from(value: Month) -> Self

Converts to this type from the input type.
Source§

impl From<Month> for i16

Source§

fn from(value: Month) -> Self

Converts to this type from the input type.
Source§

impl From<Month> for i32

Source§

fn from(value: Month) -> Self

Converts to this type from the input type.
Source§

impl From<Month> for i64

Source§

fn from(value: Month) -> Self

Converts to this type from the input type.
Source§

impl From<Month> for i8

Source§

fn from(value: Month) -> Self

Converts to this type from the input type.
Source§

impl From<Month> for u128

Source§

fn from(value: Month) -> Self

Converts to this type from the input type.
Source§

impl From<Month> for u16

Source§

fn from(value: Month) -> Self

Converts to this type from the input type.
Source§

impl From<Month> for u32

Source§

fn from(value: Month) -> Self

Converts to this type from the input type.
Source§

impl From<Month> for u64

Source§

fn from(value: Month) -> Self

Converts to this type from the input type.
Source§

impl From<Month> for u8

Source§

fn from(value: Month) -> Self

Converts to this type from the input type.
Source§

impl Hash for Month

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Month

Source§

fn cmp(&self, other: &Month) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Month

Source§

fn eq(&self, other: &Month) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Month

Source§

fn partial_cmp(&self, other: &Month) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Sub<i128> for Month

Source§

type Output = Month

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i128) -> Month

Performs the - operation. Read more
Source§

impl Sub<i16> for Month

Source§

type Output = Month

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i16) -> Month

Performs the - operation. Read more
Source§

impl Sub<i32> for Month

Source§

type Output = Month

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i32) -> Month

Performs the - operation. Read more
Source§

impl Sub<i64> for Month

Source§

type Output = Month

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i64) -> Month

Performs the - operation. Read more
Source§

impl Sub<i8> for Month

Source§

type Output = Month

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i8) -> Month

Performs the - operation. Read more
Source§

impl Sub<u128> for Month

Source§

type Output = Month

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u128) -> Month

Performs the - operation. Read more
Source§

impl Sub<u16> for Month

Source§

type Output = Month

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u16) -> Month

Performs the - operation. Read more
Source§

impl Sub<u32> for Month

Source§

type Output = Month

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u32) -> Month

Performs the - operation. Read more
Source§

impl Sub<u64> for Month

Source§

type Output = Month

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u64) -> Month

Performs the - operation. Read more
Source§

impl Sub<u8> for Month

Source§

type Output = Month

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u8) -> Month

Performs the - operation. Read more
Source§

impl TryFrom<i128> for Month

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: i128) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<i16> for Month

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: i16) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<i32> for Month

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: i32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<i64> for Month

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: i64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<i8> for Month

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: i8) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u128> for Month

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: u128) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u16> for Month

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: u16) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u32> for Month

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: u32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u64> for Month

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: u64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u8> for Month

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: u8) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Copy for Month

Source§

impl Eq for Month

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.