Enum Month

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

๐Ÿ•˜ The months of the year.

Variantsยง

ยง

January = 0

ยง

February = 1

ยง

March = 2

ยง

April = 3

ยง

May = 4

ยง

June = 5

ยง

July = 6

ยง

August = 7

ยง

September = 8

ยง

October = 9

ยง

November = 10

ยง

December = 11

Implementationsยง

Sourceยง

impl Month

Source

pub const COUNT: usize = 12usize

The number of months in a year.

Source

pub const fn len(self, leap: bool) -> u8

Returns the length in days of the current month, taking into account whether itโ€™s a leap year, for february.

Source

pub const fn previous(self) -> Month

Returns the previous month.

Source

pub const fn previous_nth(self, nth: usize) -> Month

Returns the previous nth month.

Source

pub const fn next(self) -> Month

Returns the next month.

Source

pub const fn next_nth(self, nth: usize) -> Month

Returns the next nth month.

Source

pub const fn number(self) -> u8

Returns the Month number from January=1 to December=12.

Source

pub const fn index(self) -> usize

Returns the Month index from January=0 to December=11.

Source

pub const fn from_number(n: u8) -> Result<Month, &'static str> โ“˜

Returns a Month from its counting number, from January=1 to December=12.

ยงErrors

if n < 1 || n > 12

Source

pub const fn from_index(index: usize) -> Result<Month, &'static str> โ“˜

Returns a Month from its index, from January=0 to December=11.

ยงErrors

if index > 11

Source

pub const fn from_index_unchecked(index: usize) -> Self

Returns a Month from its index, from January=0 to December=11.

ยงPanics

if index > 11

Sourceยง

impl Month

ยงabbreviations & representations

Source

pub const Jan: Month = Month::January

Source

pub const Feb: Month = Month::February

Source

pub const Mar: Month = Month::March

Source

pub const Apr: Month = Month::April

Source

pub const May: Month = Month::May

Source

pub const Jun: Month = Month::June

Source

pub const Jul: Month = Month::July

Source

pub const Aug: Month = Month::August

Source

pub const Sep: Month = Month::September

Source

pub const Oct: Month = Month::October

Source

pub const Nov: Month = Month::November

Source

pub const Dec: Month = Month::December

Source

pub const JA: Month = Month::January

Source

pub const FE: Month = Month::February

Source

pub const MR: Month = Month::March

Source

pub const AP: Month = Month::April

Source

pub const MY: Month = Month::May

Source

pub const JN: Month = Month::June

Source

pub const JL: Month = Month::July

Source

pub const AU: Month = Month::August

Source

pub const SE: Month = Month::September

Source

pub const OC: Month = Month::October

Source

pub const NV: Month = Month::November

Source

pub const DE: Month = Month::December

Source

pub const J: Month = Month::January

Source

pub const F: Month = Month::February

Source

pub const R: Month = Month::March

Source

pub const P: Month = Month::April

Source

pub const Y: Month = Month::May

Source

pub const N: Month = Month::June

Source

pub const L: Month = Month::July

Source

pub const U: Month = Month::August

Source

pub const S: Month = Month::September

Source

pub const O: Month = Month::October

Source

pub const V: Month = Month::November

Source

pub const D: Month = Month::December

Source

pub const fn abbr3(self) -> &'static str โ“˜

Returns the 3-letter abbreviated month name, in ASCII, UpperCamelCase.

Source

pub const fn abbr2(self) -> &'static str โ“˜

Returns the 2-letter abbreviated month name, in ASCII, UPPERCASE.

Source

pub const fn abbr1(self) -> &'static str โ“˜

Returns the 1-letter abbreviated month name, in ASCII, UPPERCASE.

Source

pub const fn emoji(self) -> char

Returns an emoji associated to each month.

These are: ๐ŸŒบ, ๐Ÿ‰, ๐Ÿ€, ๐Ÿฐ, ๐ŸŒผ, ๐ŸŸ, ๐ŸŒž, ๐Ÿ‚, ๐ŸŽƒ, ๐Ÿฆ‰, ๐Ÿ, ๐ŸŽ„.

Hibiscus, Dragon, Four Leaf Clover, Rabbit, Blossom, Fish, Sun with Face, Fallen Leaf, Jack-O-Lantern, Owl, Maple Leaf and Christmas Tree.

Source

pub const fn zodiac_start(self) -> char

Returns the main zodiac symbol, associated to the start of the month.

These are: โ™‘, โ™’, โ™“, โ™ˆ, โ™‰, โ™Š, โ™‹, โ™Œ, โ™, โ™Ž, โ™, โ™.

Capricorn, Aquarius, Pisces, Aries, Taurus, Gemini, Cancer, Leo, Virgo, Libra, Scorpio, Sagittarius.

ยงExamples
assert_eq![Month::July.zodiac_start(), 'โ™‹'];
Source

pub const fn zodiac_start_name(self) -> &'static str โ“˜

Returns the main zodiac name, associated to the start of the month.

These are: Capricorn, Aquarius, Pisces, Aries, Taurus, Gemini, Cancer, Leo, Virgo, Libra, Scorpio, Sagittarius.

ยงExamples
assert_eq![Month::July.zodiac_start_name(), "Cancer"];
Source

pub const fn zodiac_end(self) -> char

Returns the secondary zodiac symbol, associated to the end of the month.

These are: โ™’, โ™“, โ™ˆ, โ™‰, โ™Š, โ™‹, โ™Œ, โ™, โ™Ž, โ™, โ™, โ™‘.

ยงExamples
assert_eq![Month::July.zodiac_end(), 'โ™Œ'];
Source

pub const fn zodiac_end_name(self) -> &'static str โ“˜

Returns the secondary zodiac name, associated to the end of the month.

These are: Aquarius, Pisces, Aries, Taurus, Gemini, Cancer, Leo, Virgo, Libra, Scorpio, Sagittarius, Capricorn.

ยงExamples
assert_eq![Month::July.zodiac_end_name(), "Leo"];

Trait Implementationsยง

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<'_>) -> FmtResult<()>

Formats the value using the given formatter. Read more
Sourceยง

impl From<Month> for u8

Sourceยง

fn from(month: Month) -> Self

Converts to this type from the input type.
Sourceยง

impl FromStr for Month

Returns a Month from a string containing either the full month name, or any of the month ASCII abbreviations.

Sourceยง

type Err = &'static str

The associated error which can be returned from parsing.
Sourceยง

fn from_str(s: &str) -> Result<Month, Self::Err> โ“˜

Parses a string s to return a value of this type. Read more
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 Copy for Month

Sourceยง

impl Eq for Month

Sourceยง

impl StructuralPartialEq for Month

Auto Trait Implementationsยง

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> ByteSized for T

Sourceยง

const BYTE_ALIGN: usize = _

The alignment of this type in bytes.
Sourceยง

const BYTE_SIZE: usize = _

The size of this type in bytes.
Sourceยง

fn byte_align(&self) -> usize

Returns the alignment of this type in bytes.
Sourceยง

fn byte_size(&self) -> usize

Returns the size of this type in bytes. Read more
Sourceยง

fn ptr_size_ratio(&self) -> [usize; 2]

Returns the size ratio between Ptr::BYTES and BYTE_SIZE. Read more
Sourceยง

impl<T, R> Chain<R> for T
where T: ?Sized,

Sourceยง

fn chain<F>(self, f: F) -> R
where F: FnOnce(Self) -> R, Self: Sized,

Chain a function which takes the parameter by value.
Sourceยง

fn chain_ref<F>(&self, f: F) -> R
where F: FnOnce(&Self) -> R,

Chain a function which takes the parameter by shared reference.
Sourceยง

fn chain_mut<F>(&mut self, f: F) -> R
where F: FnOnce(&mut Self) -> R,

Chain a function which takes the parameter by exclusive reference.
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
ยง

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

ยง

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
ยง

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

ยง

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Sourceยง

impl<T> ExtAny for T
where T: Any + ?Sized,

Sourceยง

fn type_id() -> TypeId

Returns the TypeId of Self. Read more
Sourceยง

fn type_of(&self) -> TypeId

Returns the TypeId of self. Read more
Sourceยง

fn type_name(&self) -> &'static str โ“˜

Returns the type name of self. Read more
Sourceยง

fn type_is<T: 'static>(&self) -> bool

Returns true if Self is of type T. Read more
Sourceยง

fn type_hash(&self) -> u64

Returns a deterministic hash of the TypeId of Self.
Sourceยง

fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64

Returns a deterministic hash of the TypeId of Self using a custom hasher.
Sourceยง

fn as_any_ref(&self) -> &dyn Any
where Self: Sized,

Upcasts &self as &dyn Any. Read more
Sourceยง

fn as_any_mut(&mut self) -> &mut dyn Any
where Self: Sized,

Upcasts &mut self as &mut dyn Any. Read more
Sourceยง

fn as_any_box(self: Box<Self>) -> Box<dyn Any>
where Self: Sized,

Upcasts Box<self> as Box<dyn Any>. Read more
Sourceยง

fn downcast_ref<T: 'static>(&self) -> Option<&T> โ“˜

Available on crate feature unsafe_layout only.
Returns some shared reference to the inner value if it is of type T. Read more
Sourceยง

fn downcast_mut<T: 'static>(&mut self) -> Option<&mut T> โ“˜

Available on crate feature unsafe_layout only.
Returns some exclusive reference to the inner value if it is of type T. Read more
Sourceยง

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

Sourceยง

const NEEDS_DROP: bool = _

Know whether dropping values of this type matters, in compile-time.
Sourceยง

fn mem_align_of<T>() -> usize

Returns the minimum alignment of the type in bytes. Read more
Sourceยง

fn mem_align_of_val(&self) -> usize

Returns the alignment of the pointed-to value in bytes. Read more
Sourceยง

fn mem_size_of<T>() -> usize

Returns the size of a type in bytes. Read more
Sourceยง

fn mem_size_of_val(&self) -> usize

Returns the size of the pointed-to value in bytes. Read more
Sourceยง

fn mem_copy(&self) -> Self
where Self: Copy,

Bitwise-copies a value. Read more
Sourceยง

fn mem_needs_drop(&self) -> bool

Returns true if dropping values of this type matters. Read more
Sourceยง

fn mem_drop(self)
where Self: Sized,

Drops self by running its destructor. Read more
Sourceยง

fn mem_forget(self)
where Self: Sized,

Forgets about self without running its destructor. Read more
Sourceยง

fn mem_replace(&mut self, other: Self) -> Self
where Self: Sized,

Replaces self with other, returning the previous value of self. Read more
Sourceยง

fn mem_take(&mut self) -> Self
where Self: Default,

Replaces self with its default value, returning the previous value of self. Read more
Sourceยง

fn mem_swap(&mut self, other: &mut Self)
where Self: Sized,

Swaps the value of self and other without deinitializing either one. Read more
Sourceยง

unsafe fn mem_zeroed<T>() -> T

Available on crate feature unsafe_layout only.
Returns the value of type T represented by the all-zero byte-pattern. Read more
Sourceยง

unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst

Available on crate feature unsafe_layout only.
Returns the value of type T represented by the all-zero byte-pattern. Read more
Sourceยง

fn mem_as_bytes(&self) -> &[u8] โ“˜
where Self: Sync + Unpin,

Available on crate feature unsafe_slice only.
View a Sync + Unpin self as &[u8]. Read more
Sourceยง

fn mem_as_bytes_mut(&mut self) -> &mut [u8] โ“˜
where Self: Sync + Unpin,

Available on crate feature unsafe_slice only.
View a Sync + Unpin self as &mut [u8]. Read more
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

ยง

impl<S> FromSample<S> for S

ยง

fn from_sample_(s: S) -> S

Sourceยง

impl<T> Hook for T

Sourceยง

fn hook_ref<F>(self, f: F) -> Self
where F: FnOnce(&Self),

Applies a function which takes the parameter by shared reference, and then returns the (possibly) modified owned value. Read more
Sourceยง

fn hook_mut<F>(self, f: F) -> Self
where F: FnOnce(&mut Self),

Applies a function which takes the parameter by exclusive reference, and then returns the (possibly) modified owned value. Read more
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> IntoEither for T

Sourceยง

fn into_either(self, into_left: bool) -> Either<Self, Self> โ“˜

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Sourceยง

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ“˜
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
ยง

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

ยง

fn into_sample(self) -> T

ยง

impl<T> Pointable for T

ยง

const ALIGN: usize

The alignment of pointer.
ยง

type Init = T

The type for initializers.
ยง

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
ยง

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
ยง

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
ยง

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Sourceยง

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

Sourceยง

type Owned = T

The resulting type after obtaining ownership.
Sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
ยง

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

ยง

fn to_sample_(self) -> U

Sourceยง

impl<T> ToString for T
where T: Display + ?Sized,

Sourceยง

fn to_string(&self) -> String โ“˜

Converts the given value to a String. Read more
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.
ยง

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

ยง

impl<T> Ungil for T
where T: Send,