Enum nichi::DaysInYear

source ·
#[repr(u8)]
pub enum DaysInYear { ThreeSixFive = 0, ThreeSixSix = 1, }
Expand description

Days in a year accounting for leap years

Variants§

§

ThreeSixFive = 0

365 days

§

ThreeSixSix = 1

366 days (leap year)

Implementations§

source§

impl DaysInYear

source

pub const fn inner(self) -> u16

assert_eq!(DaysInYear::ThreeSixFive.inner(), 365);
assert_eq!(DaysInYear::ThreeSixSix.inner(), 366);
source

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

assert_eq!(DaysInYear::ThreeSixFive.as_str(), "ThreeSixFive");
assert_eq!(DaysInYear::ThreeSixSix.as_str(),  "ThreeSixSix");
source

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

assert_eq!(DaysInYear::ThreeSixFive.as_str_num(), "365");
assert_eq!(DaysInYear::ThreeSixSix.as_str_num(),  "366");
source

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

assert_eq!(DaysInYear::ThreeSixFive.as_str_lower(), "threesixfive");
assert_eq!(DaysInYear::ThreeSixSix.as_str_lower(),  "threesixsix");
source

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

assert_eq!(DaysInYear::ThreeSixFive.as_str_upper(), "THREESIXFIVE");
assert_eq!(DaysInYear::ThreeSixSix.as_str_upper(),  "THREESIXSIX");

Trait Implementations§

source§

impl<'__de> BorrowDecode<'__de> for DaysInYear

source§

fn borrow_decode<__D: BorrowDecoder<'__de>>( decoder: &mut __D ) -> Result<Self, DecodeError>

Attempt to decode this type with the given BorrowDecode.
source§

impl Clone for DaysInYear

source§

fn clone(&self) -> DaysInYear

Returns a copy 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 DaysInYear

source§

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

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

impl Decode for DaysInYear

source§

fn decode<__D: Decoder>(decoder: &mut __D) -> Result<Self, DecodeError>

Attempt to decode this type with the given Decode.
source§

impl Default for DaysInYear

source§

fn default() -> DaysInYear

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for DaysInYear

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for DaysInYear

source§

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

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

impl Encode for DaysInYear

source§

fn encode<__E: Encoder>(&self, encoder: &mut __E) -> Result<(), EncodeError>

Encode a given type.
source§

impl Hash for DaysInYear

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 Into<i128> for DaysInYear

source§

fn into(self) -> i128

Converts this type into the (usually inferred) input type.
source§

impl Into<i16> for DaysInYear

source§

fn into(self) -> i16

Converts this type into the (usually inferred) input type.
source§

impl Into<i32> for DaysInYear

source§

fn into(self) -> i32

Converts this type into the (usually inferred) input type.
source§

impl Into<i64> for DaysInYear

source§

fn into(self) -> i64

Converts this type into the (usually inferred) input type.
source§

impl Into<i8> for DaysInYear

source§

fn into(self) -> i8

Converts this type into the (usually inferred) input type.
source§

impl Into<isize> for DaysInYear

source§

fn into(self) -> isize

Converts this type into the (usually inferred) input type.
source§

impl Into<u128> for DaysInYear

source§

fn into(self) -> u128

Converts this type into the (usually inferred) input type.
source§

impl Into<u16> for DaysInYear

source§

fn into(self) -> u16

Converts this type into the (usually inferred) input type.
source§

impl Into<u32> for DaysInYear

source§

fn into(self) -> u32

Converts this type into the (usually inferred) input type.
source§

impl Into<u64> for DaysInYear

source§

fn into(self) -> u64

Converts this type into the (usually inferred) input type.
source§

impl Into<u8> for DaysInYear

source§

fn into(self) -> u8

Converts this type into the (usually inferred) input type.
source§

impl Into<usize> for DaysInYear

source§

fn into(self) -> usize

Converts this type into the (usually inferred) input type.
source§

impl Ord for DaysInYear

source§

fn cmp(&self, other: &DaysInYear) -> 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 + PartialOrd,

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

impl PartialEq<i128> for DaysInYear

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<i16> for DaysInYear

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<i32> for DaysInYear

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<i64> for DaysInYear

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<i8> for DaysInYear

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<isize> for DaysInYear

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u128> for DaysInYear

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u16> for DaysInYear

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u32> for DaysInYear

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u64> for DaysInYear

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u8> for DaysInYear

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<usize> for DaysInYear

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq for DaysInYear

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for DaysInYear

source§

fn partial_cmp(&self, other: &DaysInYear) -> 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

This method 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

This method 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

This method 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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for DaysInYear

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for DaysInYear

source§

impl Eq for DaysInYear

source§

impl StructuralEq for DaysInYear

source§

impl StructuralPartialEq for DaysInYear

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> 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> ToOwned for T
where T: Clone,

§

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
source§

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

source§

default 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>,

§

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>,

§

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.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,