Month

Enum Month 

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

§Month.

This enum is used by Utc2k to differentiate between calendar months.

§Examples

use utc2k::Month;

// The first.
assert_eq!(Month::January as u8, 1_u8);
assert_eq!(Month::January.as_str(), "January");
assert_eq!(Month::January.abbreviation(), "Jan");

// The last.
assert_eq!(Month::December as u8, 12_u8);
assert_eq!(Month::December.as_str(), "December");
assert_eq!(Month::December.abbreviation(), "Dec");

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§

Source§

impl Month

Source

pub const ALL: [Self; 12]

§All Months.

This array contains all of the months, in order.

§Examples
for pair in utc2k::Month::ALL.windows(2) {
    assert!(pair[0] < pair[1]);
}
Source

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

§As String Slice (Abbreviated).

Return the three-letter abbreviation for a given month as a static string slice.

§Examples
use utc2k::Month;

assert_eq!(Month::January.abbreviation(), "Jan");
assert_eq!(Month::February.abbreviation(), "Feb");
assert_eq!(Month::March.abbreviation(), "Mar");
assert_eq!(Month::April.abbreviation(), "Apr");
assert_eq!(Month::May.abbreviation(), "May");
assert_eq!(Month::June.abbreviation(), "Jun");
assert_eq!(Month::July.abbreviation(), "Jul");
assert_eq!(Month::August.abbreviation(), "Aug");
assert_eq!(Month::September.abbreviation(), "Sep");
assert_eq!(Month::October.abbreviation(), "Oct");
assert_eq!(Month::November.abbreviation(), "Nov");
assert_eq!(Month::December.abbreviation(), "Dec");
Source

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

§As String Slice.

Return the name of a given month as a static string slice.

§Examples
use utc2k::Month;

assert_eq!(Month::January.as_str(), "January");
assert_eq!(Month::February.as_str(), "February");
assert_eq!(Month::March.as_str(), "March");
assert_eq!(Month::April.as_str(), "April");
assert_eq!(Month::May.as_str(), "May");
assert_eq!(Month::June.as_str(), "June");
assert_eq!(Month::July.as_str(), "July");
assert_eq!(Month::August.as_str(), "August");
assert_eq!(Month::September.as_str(), "September");
assert_eq!(Month::October.as_str(), "October");
assert_eq!(Month::November.as_str(), "November");
assert_eq!(Month::December.as_str(), "December");
Source

pub const fn previous(self) -> Self

§Previous Month (Wrapping).

Return the previous Month.

§Examples
use utc2k::Month;

assert_eq!(Month::January.previous(), Month::December);
assert_eq!(Month::February.previous(), Month::January);
assert_eq!(Month::March.previous(), Month::February);
assert_eq!(Month::April.previous(), Month::March);
assert_eq!(Month::May.previous(), Month::April);
assert_eq!(Month::June.previous(), Month::May);
assert_eq!(Month::July.previous(), Month::June);
assert_eq!(Month::August.previous(), Month::July);
assert_eq!(Month::September.previous(), Month::August);
assert_eq!(Month::October.previous(), Month::September);
assert_eq!(Month::November.previous(), Month::October);
assert_eq!(Month::December.previous(), Month::November);

// Same as math:
assert_eq!(Month::January.previous(), Month::January - 1_u8);

// Same as the proper iterator too (provided you skip the first value):
assert_eq!(
    Some(Month::January.previous()),
    Month::January.into_iter().rev().skip(1).next(),
);
Source

pub const fn next(self) -> Self

§Next Month (Wrapping).

Return the next Month.

§Examples
use utc2k::Month;

assert_eq!(Month::January.next(), Month::February);
assert_eq!(Month::February.next(), Month::March);
assert_eq!(Month::March.next(), Month::April);
assert_eq!(Month::April.next(), Month::May);
assert_eq!(Month::May.next(), Month::June);
assert_eq!(Month::June.next(), Month::July);
assert_eq!(Month::July.next(), Month::August);
assert_eq!(Month::August.next(), Month::September);
assert_eq!(Month::September.next(), Month::October);
assert_eq!(Month::October.next(), Month::November);
assert_eq!(Month::November.next(), Month::December);
assert_eq!(Month::December.next(), Month::January);

// Same as math:
assert_eq!(Month::January.next(), Month::January + 1_u8);

// Same as the proper iterator too (provided you skip the first value):
assert_eq!(
    Some(Month::January.next()),
    Month::January.into_iter().skip(1).next(),
);
Source

pub const fn cmp(a: Self, b: Self) -> Ordering

§Compare Two Months.

Same as Ord/PartialOrd, but constant.

§Examples
use utc2k::Month;

assert_eq!(
    Month::January.cmp(&Month::January),
    Month::cmp(Month::January, Month::January), // Ordering::Equal
);
assert_eq!(
    Month::January.cmp(&Month::December),
    Month::cmp(Month::January, Month::December), // Ordering::Less
);
assert_eq!(
    Month::December.cmp(&Month::January),
    Month::cmp(Month::December, Month::January), // Ordering::Greater
);
Source§

impl Month

Source

pub fn now() -> Self

§Current Month.

Return the current month.

§Examples.
use utc2k::{Month, Utc2k};

assert_eq!(Month::now(), Utc2k::now().month());
Source§

impl Month

Source

pub const fn days(self) -> u8

§Month Size (Days).

This returns the total number of days this month could hold, or put another way, the last day of this month.

Note: this method is not leap-aware. If the month is February and it is in a leap year, be sure to add 1 to reach 29!

§Examples
use utc2k::Month;

assert_eq!(Month::January.days(), 31);
assert_eq!(Month::February.days(), 28); // Not leap-aware.
assert_eq!(Month::March.days(), 31);
assert_eq!(Month::April.days(), 30);
// …

Trait Implementations§

Source§

impl Add<u16> for Month

Source§

fn add(self, other: u16) -> Self

§Wrapping u16 Addition.

Months range from 1..=12, starting with January.

§Examples
use utc2k::Month;

let start = Month::January;
assert_eq!(start + 0_u16, Month::January); // Noop.
assert_eq!(start + 1_u16, Month::February); 
assert_eq!(start + 2_u16, Month::March); 
assert_eq!(start + 3_u16, Month::April); 
assert_eq!(start + 4_u16, Month::May); 
assert_eq!(start + 5_u16, Month::June); 
assert_eq!(start + 6_u16, Month::July); 
assert_eq!(start + 7_u16, Month::August); 
assert_eq!(start + 8_u16, Month::September); 
assert_eq!(start + 9_u16, Month::October); 
assert_eq!(start + 10_u16, Month::November); 
assert_eq!(start + 11_u16, Month::December); 
assert_eq!(start + 12_u16, Month::January); // Wrap.
assert_eq!(start + 13_u16, Month::February); // Wrap.
assert_eq!(start + 14_u16, Month::March); // Wrap.
// …
Source§

type Output = Month

The resulting type after applying the + operator.
Source§

impl Add<u32> for Month

Source§

fn add(self, other: u32) -> Self

§Wrapping u32 Addition.

Months range from 1..=12, starting with January.

§Examples
use utc2k::Month;

let start = Month::January;
assert_eq!(start + 0_u32, Month::January); // Noop.
assert_eq!(start + 1_u32, Month::February); 
assert_eq!(start + 2_u32, Month::March); 
assert_eq!(start + 3_u32, Month::April); 
assert_eq!(start + 4_u32, Month::May); 
assert_eq!(start + 5_u32, Month::June); 
assert_eq!(start + 6_u32, Month::July); 
assert_eq!(start + 7_u32, Month::August); 
assert_eq!(start + 8_u32, Month::September); 
assert_eq!(start + 9_u32, Month::October); 
assert_eq!(start + 10_u32, Month::November); 
assert_eq!(start + 11_u32, Month::December); 
assert_eq!(start + 12_u32, Month::January); // Wrap.
assert_eq!(start + 13_u32, Month::February); // Wrap.
assert_eq!(start + 14_u32, Month::March); // Wrap.
// …
Source§

type Output = Month

The resulting type after applying the + operator.
Source§

impl Add<u64> for Month

Source§

fn add(self, other: u64) -> Self

§Wrapping u64 Addition.

Months range from 1..=12, starting with January.

§Examples
use utc2k::Month;

let start = Month::January;
assert_eq!(start + 0_u64, Month::January); // Noop.
assert_eq!(start + 1_u64, Month::February); 
assert_eq!(start + 2_u64, Month::March); 
assert_eq!(start + 3_u64, Month::April); 
assert_eq!(start + 4_u64, Month::May); 
assert_eq!(start + 5_u64, Month::June); 
assert_eq!(start + 6_u64, Month::July); 
assert_eq!(start + 7_u64, Month::August); 
assert_eq!(start + 8_u64, Month::September); 
assert_eq!(start + 9_u64, Month::October); 
assert_eq!(start + 10_u64, Month::November); 
assert_eq!(start + 11_u64, Month::December); 
assert_eq!(start + 12_u64, Month::January); // Wrap.
assert_eq!(start + 13_u64, Month::February); // Wrap.
assert_eq!(start + 14_u64, Month::March); // Wrap.
// …
Source§

type Output = Month

The resulting type after applying the + operator.
Source§

impl Add<u8> for Month

Source§

fn add(self, other: u8) -> Self

§Wrapping u8 Addition.

Months range from 1..=12, starting with January.

§Examples
use utc2k::Month;

let start = Month::January;
assert_eq!(start + 0_u8, Month::January); // Noop.
assert_eq!(start + 1_u8, Month::February); 
assert_eq!(start + 2_u8, Month::March); 
assert_eq!(start + 3_u8, Month::April); 
assert_eq!(start + 4_u8, Month::May); 
assert_eq!(start + 5_u8, Month::June); 
assert_eq!(start + 6_u8, Month::July); 
assert_eq!(start + 7_u8, Month::August); 
assert_eq!(start + 8_u8, Month::September); 
assert_eq!(start + 9_u8, Month::October); 
assert_eq!(start + 10_u8, Month::November); 
assert_eq!(start + 11_u8, Month::December); 
assert_eq!(start + 12_u8, Month::January); // Wrap.
assert_eq!(start + 13_u8, Month::February); // Wrap.
assert_eq!(start + 14_u8, Month::March); // Wrap.
// …
Source§

type Output = Month

The resulting type after applying the + operator.
Source§

impl Add<usize> for Month

Source§

fn add(self, other: usize) -> Self

§Wrapping usize Addition.

Months range from 1..=12, starting with January.

§Examples
use utc2k::Month;

let start = Month::January;
assert_eq!(start + 0_usize, Month::January); // Noop.
assert_eq!(start + 1_usize, Month::February); 
assert_eq!(start + 2_usize, Month::March); 
assert_eq!(start + 3_usize, Month::April); 
assert_eq!(start + 4_usize, Month::May); 
assert_eq!(start + 5_usize, Month::June); 
assert_eq!(start + 6_usize, Month::July); 
assert_eq!(start + 7_usize, Month::August); 
assert_eq!(start + 8_usize, Month::September); 
assert_eq!(start + 9_usize, Month::October); 
assert_eq!(start + 10_usize, Month::November); 
assert_eq!(start + 11_usize, Month::December); 
assert_eq!(start + 12_usize, Month::January); // Wrap.
assert_eq!(start + 13_usize, Month::February); // Wrap.
assert_eq!(start + 14_usize, Month::March); // Wrap.
// …
Source§

type Output = Month

The resulting type after applying the + operator.
Source§

impl AddAssign<u16> for Month

Source§

fn add_assign(&mut self, other: u16)

Performs the += operation. Read more
Source§

impl AddAssign<u32> for Month

Source§

fn add_assign(&mut self, other: u32)

Performs the += operation. Read more
Source§

impl AddAssign<u64> for Month

Source§

fn add_assign(&mut self, other: u64)

Performs the += operation. Read more
Source§

impl AddAssign<u8> for Month

Source§

fn add_assign(&mut self, other: u8)

Performs the += operation. Read more
Source§

impl AddAssign<usize> for Month

Source§

fn add_assign(&mut self, other: usize)

Performs the += operation. Read more
Source§

impl AsRef<str> for Month

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<str> for Month

Source§

fn borrow(&self) -> &str

Immutably borrows from an owned value. 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 Default for Month

Source§

fn default() -> Month

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

impl<'de> Deserialize<'de> for Month

Available on crate feature serde only.
Source§

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

§Deserialize.

Use the optional serde crate feature to enable serialization support.

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 u16

Source§

fn from(src: Month) -> Self

§u16 From Month.

Months range from 1..=12, starting with January.

§Examples
use utc2k::Month;

assert_eq!(u16::from(Month::January), 1);
assert_eq!(u16::from(Month::February), 2);
assert_eq!(u16::from(Month::March), 3);
assert_eq!(u16::from(Month::April), 4);
assert_eq!(u16::from(Month::May), 5);
assert_eq!(u16::from(Month::June), 6);
assert_eq!(u16::from(Month::July), 7);
assert_eq!(u16::from(Month::August), 8);
assert_eq!(u16::from(Month::September), 9);
assert_eq!(u16::from(Month::October), 10);
assert_eq!(u16::from(Month::November), 11);
assert_eq!(u16::from(Month::December), 12);

// Same as `as` casting.
for v in Month::ALL {
    assert_eq!(u16::from(v), v as u16);
}
Source§

impl From<Month> for u32

Source§

fn from(src: Month) -> Self

§u32 From Month.

Months range from 1..=12, starting with January.

§Examples
use utc2k::Month;

assert_eq!(u32::from(Month::January), 1);
assert_eq!(u32::from(Month::February), 2);
assert_eq!(u32::from(Month::March), 3);
assert_eq!(u32::from(Month::April), 4);
assert_eq!(u32::from(Month::May), 5);
assert_eq!(u32::from(Month::June), 6);
assert_eq!(u32::from(Month::July), 7);
assert_eq!(u32::from(Month::August), 8);
assert_eq!(u32::from(Month::September), 9);
assert_eq!(u32::from(Month::October), 10);
assert_eq!(u32::from(Month::November), 11);
assert_eq!(u32::from(Month::December), 12);

// Same as `as` casting.
for v in Month::ALL {
    assert_eq!(u32::from(v), v as u32);
}
Source§

impl From<Month> for u64

Source§

fn from(src: Month) -> Self

§u64 From Month.

Months range from 1..=12, starting with January.

§Examples
use utc2k::Month;

assert_eq!(u64::from(Month::January), 1);
assert_eq!(u64::from(Month::February), 2);
assert_eq!(u64::from(Month::March), 3);
assert_eq!(u64::from(Month::April), 4);
assert_eq!(u64::from(Month::May), 5);
assert_eq!(u64::from(Month::June), 6);
assert_eq!(u64::from(Month::July), 7);
assert_eq!(u64::from(Month::August), 8);
assert_eq!(u64::from(Month::September), 9);
assert_eq!(u64::from(Month::October), 10);
assert_eq!(u64::from(Month::November), 11);
assert_eq!(u64::from(Month::December), 12);

// Same as `as` casting.
for v in Month::ALL {
    assert_eq!(u64::from(v), v as u64);
}
Source§

impl From<Month> for u8

Source§

fn from(src: Month) -> Self

§u8 From Month.

Months range from 1..=12, starting with January.

§Examples
use utc2k::Month;

assert_eq!(u8::from(Month::January), 1);
assert_eq!(u8::from(Month::February), 2);
assert_eq!(u8::from(Month::March), 3);
assert_eq!(u8::from(Month::April), 4);
assert_eq!(u8::from(Month::May), 5);
assert_eq!(u8::from(Month::June), 6);
assert_eq!(u8::from(Month::July), 7);
assert_eq!(u8::from(Month::August), 8);
assert_eq!(u8::from(Month::September), 9);
assert_eq!(u8::from(Month::October), 10);
assert_eq!(u8::from(Month::November), 11);
assert_eq!(u8::from(Month::December), 12);

// Same as `as` casting.
for v in Month::ALL {
    assert_eq!(u8::from(v), v as u8);
}
Source§

impl From<Month> for usize

Source§

fn from(src: Month) -> Self

§usize From Month.

Months range from 1..=12, starting with January.

§Examples
use utc2k::Month;

assert_eq!(usize::from(Month::January), 1);
assert_eq!(usize::from(Month::February), 2);
assert_eq!(usize::from(Month::March), 3);
assert_eq!(usize::from(Month::April), 4);
assert_eq!(usize::from(Month::May), 5);
assert_eq!(usize::from(Month::June), 6);
assert_eq!(usize::from(Month::July), 7);
assert_eq!(usize::from(Month::August), 8);
assert_eq!(usize::from(Month::September), 9);
assert_eq!(usize::from(Month::October), 10);
assert_eq!(usize::from(Month::November), 11);
assert_eq!(usize::from(Month::December), 12);

// Same as `as` casting.
for v in Month::ALL {
    assert_eq!(usize::from(v), v as usize);
}
Source§

impl From<Utc2k> for Month

Source§

fn from(src: Utc2k) -> Self

§From Utc2k.

This is equivalent to calling Utc2k::month.

§Examples
use utc2k::{Month, Utc2k};

let utc = Utc2k::new(2030, 1, 6, 0, 0, 0);
assert_eq!(Month::January, Month::from(utc));
assert_eq!(Month::January, utc.month());
Source§

impl From<u16> for Month

Source§

fn from(src: u16) -> Self

§Month From u16 (Wrapping).

Months range from 1..=12, starting with January.

§Examples
use utc2k::Month;

assert_eq!(Month::from(0_u16), Month::December); // Wrap.
assert_eq!(Month::from(1_u16), Month::January);
assert_eq!(Month::from(2_u16), Month::February);
assert_eq!(Month::from(3_u16), Month::March);
assert_eq!(Month::from(4_u16), Month::April);
assert_eq!(Month::from(5_u16), Month::May);
assert_eq!(Month::from(6_u16), Month::June);
assert_eq!(Month::from(7_u16), Month::July);
assert_eq!(Month::from(8_u16), Month::August);
assert_eq!(Month::from(9_u16), Month::September);
assert_eq!(Month::from(10_u16), Month::October);
assert_eq!(Month::from(11_u16), Month::November);
assert_eq!(Month::from(12_u16), Month::December);
assert_eq!(Month::from(13_u16), Month::January); // Wrap.
assert_eq!(Month::from(14_u16), Month::February); // Wrap.
assert_eq!(Month::from(15_u16), Month::March); // Wrap.
// …
Source§

impl From<u32> for Month

Source§

fn from(src: u32) -> Self

§Month From u32 (Wrapping).

Months range from 1..=12, starting with January.

§Examples
use utc2k::Month;

assert_eq!(Month::from(0_u32), Month::December); // Wrap.
assert_eq!(Month::from(1_u32), Month::January);
assert_eq!(Month::from(2_u32), Month::February);
assert_eq!(Month::from(3_u32), Month::March);
assert_eq!(Month::from(4_u32), Month::April);
assert_eq!(Month::from(5_u32), Month::May);
assert_eq!(Month::from(6_u32), Month::June);
assert_eq!(Month::from(7_u32), Month::July);
assert_eq!(Month::from(8_u32), Month::August);
assert_eq!(Month::from(9_u32), Month::September);
assert_eq!(Month::from(10_u32), Month::October);
assert_eq!(Month::from(11_u32), Month::November);
assert_eq!(Month::from(12_u32), Month::December);
assert_eq!(Month::from(13_u32), Month::January); // Wrap.
assert_eq!(Month::from(14_u32), Month::February); // Wrap.
assert_eq!(Month::from(15_u32), Month::March); // Wrap.
// …
Source§

impl From<u64> for Month

Source§

fn from(src: u64) -> Self

§Month From u64 (Wrapping).

Months range from 1..=12, starting with January.

§Examples
use utc2k::Month;

assert_eq!(Month::from(0_u64), Month::December); // Wrap.
assert_eq!(Month::from(1_u64), Month::January);
assert_eq!(Month::from(2_u64), Month::February);
assert_eq!(Month::from(3_u64), Month::March);
assert_eq!(Month::from(4_u64), Month::April);
assert_eq!(Month::from(5_u64), Month::May);
assert_eq!(Month::from(6_u64), Month::June);
assert_eq!(Month::from(7_u64), Month::July);
assert_eq!(Month::from(8_u64), Month::August);
assert_eq!(Month::from(9_u64), Month::September);
assert_eq!(Month::from(10_u64), Month::October);
assert_eq!(Month::from(11_u64), Month::November);
assert_eq!(Month::from(12_u64), Month::December);
assert_eq!(Month::from(13_u64), Month::January); // Wrap.
assert_eq!(Month::from(14_u64), Month::February); // Wrap.
assert_eq!(Month::from(15_u64), Month::March); // Wrap.
// …
Source§

impl From<u8> for Month

Source§

fn from(src: u8) -> Self

§Month From u8 (Wrapping).

Months range from 1..=12, starting with January.

§Examples
use utc2k::Month;

assert_eq!(Month::from(0_u8), Month::December); // Wrap.
assert_eq!(Month::from(1_u8), Month::January);
assert_eq!(Month::from(2_u8), Month::February);
assert_eq!(Month::from(3_u8), Month::March);
assert_eq!(Month::from(4_u8), Month::April);
assert_eq!(Month::from(5_u8), Month::May);
assert_eq!(Month::from(6_u8), Month::June);
assert_eq!(Month::from(7_u8), Month::July);
assert_eq!(Month::from(8_u8), Month::August);
assert_eq!(Month::from(9_u8), Month::September);
assert_eq!(Month::from(10_u8), Month::October);
assert_eq!(Month::from(11_u8), Month::November);
assert_eq!(Month::from(12_u8), Month::December);
assert_eq!(Month::from(13_u8), Month::January); // Wrap.
assert_eq!(Month::from(14_u8), Month::February); // Wrap.
assert_eq!(Month::from(15_u8), Month::March); // Wrap.
// …
Source§

impl From<usize> for Month

Source§

fn from(src: usize) -> Self

§Month From usize (Wrapping).

Months range from 1..=12, starting with January.

§Examples
use utc2k::Month;

assert_eq!(Month::from(0_usize), Month::December); // Wrap.
assert_eq!(Month::from(1_usize), Month::January);
assert_eq!(Month::from(2_usize), Month::February);
assert_eq!(Month::from(3_usize), Month::March);
assert_eq!(Month::from(4_usize), Month::April);
assert_eq!(Month::from(5_usize), Month::May);
assert_eq!(Month::from(6_usize), Month::June);
assert_eq!(Month::from(7_usize), Month::July);
assert_eq!(Month::from(8_usize), Month::August);
assert_eq!(Month::from(9_usize), Month::September);
assert_eq!(Month::from(10_usize), Month::October);
assert_eq!(Month::from(11_usize), Month::November);
assert_eq!(Month::from(12_usize), Month::December);
assert_eq!(Month::from(13_usize), Month::January); // Wrap.
assert_eq!(Month::from(14_usize), Month::February); // Wrap.
assert_eq!(Month::from(15_usize), Month::March); // Wrap.
// …
Source§

impl FromStr for Month

Source§

fn from_str(src: &str) -> Result<Self, Self::Err>

§Parse From String.

Parse a Month from the first three letters of a string, case-insensitively.

§Examples
use utc2k::Month;

for v in Month::ALL {
    assert_eq!(v.as_str().parse::<Month>(), Ok(v));
    assert_eq!(v.abbreviation().parse::<Month>(), Ok(v));
}

// Remember that only the first three letters count!
assert_eq!("Janissary".parse::<Month>(), Ok(Month::January));
Source§

type Err = Utc2kError

The associated error which can be returned from parsing.
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 IntoIterator for Month

Source§

fn into_iter(self) -> Self::IntoIter

§Endless Month Iterator.

Return an iterator that will cycle endlessly through the months, in order, forward or backward, starting with self.

§Examples
use utc2k::Month;

let mut iter = Month::January.into_iter();
assert_eq!(iter.next(), Some(Month::January)); 
assert_eq!(iter.next(), Some(Month::February)); 
assert_eq!(iter.next(), Some(Month::March)); 
assert_eq!(iter.next(), Some(Month::April)); 
assert_eq!(iter.next(), Some(Month::May)); 
assert_eq!(iter.next(), Some(Month::June)); 
assert_eq!(iter.next(), Some(Month::July)); 
assert_eq!(iter.next(), Some(Month::August)); 
assert_eq!(iter.next(), Some(Month::September)); 
assert_eq!(iter.next(), Some(Month::October)); 
assert_eq!(iter.next(), Some(Month::November)); 
assert_eq!(iter.next(), Some(Month::December)); 
assert_eq!(iter.next(), Some(Month::January)); // Wrap.
assert_eq!(iter.next(), Some(Month::February)); // Wrap.
assert_eq!(iter.next(), Some(Month::March)); // Wrap.
// …

// Or like Ginger:
let mut iter = Month::December.into_iter().rev();
assert_eq!(iter.next(), Some(Month::December)); 
assert_eq!(iter.next(), Some(Month::November)); 
assert_eq!(iter.next(), Some(Month::October)); 
assert_eq!(iter.next(), Some(Month::September)); 
assert_eq!(iter.next(), Some(Month::August)); 
assert_eq!(iter.next(), Some(Month::July)); 
assert_eq!(iter.next(), Some(Month::June)); 
assert_eq!(iter.next(), Some(Month::May)); 
assert_eq!(iter.next(), Some(Month::April)); 
assert_eq!(iter.next(), Some(Month::March)); 
assert_eq!(iter.next(), Some(Month::February)); 
assert_eq!(iter.next(), Some(Month::January)); 
assert_eq!(iter.next(), Some(Month::December)); // Wrap.
assert_eq!(iter.next(), Some(Month::November)); // Wrap.
assert_eq!(iter.next(), Some(Month::October)); // Wrap.
// …
Source§

type Item = Month

The type of the elements being iterated over.
Source§

type IntoIter = RepeatingMonthIter

Which kind of iterator are we turning this into?
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<Month> for u16

Source§

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

§u16/Month Equality.
use utc2k::Month;

assert_eq!(1_u16, Month::January);
assert_eq!(2_u16, Month::February);
assert_eq!(3_u16, Month::March);
assert_eq!(4_u16, Month::April);
assert_eq!(5_u16, Month::May);
assert_eq!(6_u16, Month::June);
assert_eq!(7_u16, Month::July);
assert_eq!(8_u16, Month::August);
assert_eq!(9_u16, Month::September);
assert_eq!(10_u16, Month::October);
assert_eq!(11_u16, Month::November);
assert_eq!(12_u16, Month::December);

// Nope. assert_ne!(u16::MIN, Month::January);

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 PartialEq<Month> for u32

Source§

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

§u32/Month Equality.
use utc2k::Month;

assert_eq!(1_u32, Month::January);
assert_eq!(2_u32, Month::February);
assert_eq!(3_u32, Month::March);
assert_eq!(4_u32, Month::April);
assert_eq!(5_u32, Month::May);
assert_eq!(6_u32, Month::June);
assert_eq!(7_u32, Month::July);
assert_eq!(8_u32, Month::August);
assert_eq!(9_u32, Month::September);
assert_eq!(10_u32, Month::October);
assert_eq!(11_u32, Month::November);
assert_eq!(12_u32, Month::December);

// Nope. assert_ne!(u32::MIN, Month::January);

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 PartialEq<Month> for u64

Source§

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

§u64/Month Equality.
use utc2k::Month;

assert_eq!(1_u64, Month::January);
assert_eq!(2_u64, Month::February);
assert_eq!(3_u64, Month::March);
assert_eq!(4_u64, Month::April);
assert_eq!(5_u64, Month::May);
assert_eq!(6_u64, Month::June);
assert_eq!(7_u64, Month::July);
assert_eq!(8_u64, Month::August);
assert_eq!(9_u64, Month::September);
assert_eq!(10_u64, Month::October);
assert_eq!(11_u64, Month::November);
assert_eq!(12_u64, Month::December);

// Nope. assert_ne!(u64::MIN, Month::January);

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 PartialEq<Month> for u8

Source§

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

§u8/Month Equality.
use utc2k::Month;

assert_eq!(1_u8, Month::January);
assert_eq!(2_u8, Month::February);
assert_eq!(3_u8, Month::March);
assert_eq!(4_u8, Month::April);
assert_eq!(5_u8, Month::May);
assert_eq!(6_u8, Month::June);
assert_eq!(7_u8, Month::July);
assert_eq!(8_u8, Month::August);
assert_eq!(9_u8, Month::September);
assert_eq!(10_u8, Month::October);
assert_eq!(11_u8, Month::November);
assert_eq!(12_u8, Month::December);

// Nope. assert_ne!(u8::MIN, Month::January);

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 PartialEq<Month> for usize

Source§

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

§usize/Month Equality.
use utc2k::Month;

assert_eq!(1_usize, Month::January);
assert_eq!(2_usize, Month::February);
assert_eq!(3_usize, Month::March);
assert_eq!(4_usize, Month::April);
assert_eq!(5_usize, Month::May);
assert_eq!(6_usize, Month::June);
assert_eq!(7_usize, Month::July);
assert_eq!(8_usize, Month::August);
assert_eq!(9_usize, Month::September);
assert_eq!(10_usize, Month::October);
assert_eq!(11_usize, Month::November);
assert_eq!(12_usize, Month::December);

// Nope. assert_ne!(usize::MIN, Month::January);

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 PartialEq<u16> for Month

Source§

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

§Month/u16 Equality.
use utc2k::Month;

assert_eq!(Month::January, 1_u16);
assert_eq!(Month::February, 2_u16);
assert_eq!(Month::March, 3_u16);
assert_eq!(Month::April, 4_u16);
assert_eq!(Month::May, 5_u16);
assert_eq!(Month::June, 6_u16);
assert_eq!(Month::July, 7_u16);
assert_eq!(Month::August, 8_u16);
assert_eq!(Month::September, 9_u16);
assert_eq!(Month::October, 10_u16);
assert_eq!(Month::November, 11_u16);
assert_eq!(Month::December, 12_u16);

// Nope.
assert_ne!(Month::January, u16::MIN);
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 PartialEq<u32> for Month

Source§

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

§Month/u32 Equality.
use utc2k::Month;

assert_eq!(Month::January, 1_u32);
assert_eq!(Month::February, 2_u32);
assert_eq!(Month::March, 3_u32);
assert_eq!(Month::April, 4_u32);
assert_eq!(Month::May, 5_u32);
assert_eq!(Month::June, 6_u32);
assert_eq!(Month::July, 7_u32);
assert_eq!(Month::August, 8_u32);
assert_eq!(Month::September, 9_u32);
assert_eq!(Month::October, 10_u32);
assert_eq!(Month::November, 11_u32);
assert_eq!(Month::December, 12_u32);

// Nope.
assert_ne!(Month::January, u32::MIN);
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 PartialEq<u64> for Month

Source§

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

§Month/u64 Equality.
use utc2k::Month;

assert_eq!(Month::January, 1_u64);
assert_eq!(Month::February, 2_u64);
assert_eq!(Month::March, 3_u64);
assert_eq!(Month::April, 4_u64);
assert_eq!(Month::May, 5_u64);
assert_eq!(Month::June, 6_u64);
assert_eq!(Month::July, 7_u64);
assert_eq!(Month::August, 8_u64);
assert_eq!(Month::September, 9_u64);
assert_eq!(Month::October, 10_u64);
assert_eq!(Month::November, 11_u64);
assert_eq!(Month::December, 12_u64);

// Nope.
assert_ne!(Month::January, u64::MIN);
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 PartialEq<u8> for Month

Source§

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

§Month/u8 Equality.
use utc2k::Month;

assert_eq!(Month::January, 1_u8);
assert_eq!(Month::February, 2_u8);
assert_eq!(Month::March, 3_u8);
assert_eq!(Month::April, 4_u8);
assert_eq!(Month::May, 5_u8);
assert_eq!(Month::June, 6_u8);
assert_eq!(Month::July, 7_u8);
assert_eq!(Month::August, 8_u8);
assert_eq!(Month::September, 9_u8);
assert_eq!(Month::October, 10_u8);
assert_eq!(Month::November, 11_u8);
assert_eq!(Month::December, 12_u8);

// Nope.
assert_ne!(Month::January, u8::MIN);
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 PartialEq<usize> for Month

Source§

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

§Month/usize Equality.
use utc2k::Month;

assert_eq!(Month::January, 1_usize);
assert_eq!(Month::February, 2_usize);
assert_eq!(Month::March, 3_usize);
assert_eq!(Month::April, 4_usize);
assert_eq!(Month::May, 5_usize);
assert_eq!(Month::June, 6_usize);
assert_eq!(Month::July, 7_usize);
assert_eq!(Month::August, 8_usize);
assert_eq!(Month::September, 9_usize);
assert_eq!(Month::October, 10_usize);
assert_eq!(Month::November, 11_usize);
assert_eq!(Month::December, 12_usize);

// Nope.
assert_ne!(Month::January, usize::MIN);
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 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 Serialize for Month

Available on crate feature serde only.
Source§

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

§Serialize.

Use the optional serde crate feature to enable serialization support.

Source§

impl Sub<u16> for Month

Source§

fn sub(self, other: u16) -> Self

§Wrapping u16 Subtraction.

Months range from 1..=12, starting with January.

§Examples
use utc2k::Month;

let start = Month::January;
assert_eq!(start - 0_u16, Month::January); // Noop.
assert_eq!(start - 1_u16, Month::December); 
assert_eq!(start - 2_u16, Month::November); 
assert_eq!(start - 3_u16, Month::October); 
assert_eq!(start - 4_u16, Month::September); 
assert_eq!(start - 5_u16, Month::August); 
assert_eq!(start - 6_u16, Month::July); 
assert_eq!(start - 7_u16, Month::June); 
assert_eq!(start - 8_u16, Month::May); 
assert_eq!(start - 9_u16, Month::April); 
assert_eq!(start - 10_u16, Month::March); 
assert_eq!(start - 11_u16, Month::February); 
assert_eq!(start - 12_u16, Month::January); // Wrap.
assert_eq!(start - 13_u16, Month::December); // Wrap.
assert_eq!(start - 14_u16, Month::November); // Wrap.
// …
Source§

type Output = Month

The resulting type after applying the - operator.
Source§

impl Sub<u32> for Month

Source§

fn sub(self, other: u32) -> Self

§Wrapping u32 Subtraction.

Months range from 1..=12, starting with January.

§Examples
use utc2k::Month;

let start = Month::January;
assert_eq!(start - 0_u32, Month::January); // Noop.
assert_eq!(start - 1_u32, Month::December); 
assert_eq!(start - 2_u32, Month::November); 
assert_eq!(start - 3_u32, Month::October); 
assert_eq!(start - 4_u32, Month::September); 
assert_eq!(start - 5_u32, Month::August); 
assert_eq!(start - 6_u32, Month::July); 
assert_eq!(start - 7_u32, Month::June); 
assert_eq!(start - 8_u32, Month::May); 
assert_eq!(start - 9_u32, Month::April); 
assert_eq!(start - 10_u32, Month::March); 
assert_eq!(start - 11_u32, Month::February); 
assert_eq!(start - 12_u32, Month::January); // Wrap.
assert_eq!(start - 13_u32, Month::December); // Wrap.
assert_eq!(start - 14_u32, Month::November); // Wrap.
// …
Source§

type Output = Month

The resulting type after applying the - operator.
Source§

impl Sub<u64> for Month

Source§

fn sub(self, other: u64) -> Self

§Wrapping u64 Subtraction.

Months range from 1..=12, starting with January.

§Examples
use utc2k::Month;

let start = Month::January;
assert_eq!(start - 0_u64, Month::January); // Noop.
assert_eq!(start - 1_u64, Month::December); 
assert_eq!(start - 2_u64, Month::November); 
assert_eq!(start - 3_u64, Month::October); 
assert_eq!(start - 4_u64, Month::September); 
assert_eq!(start - 5_u64, Month::August); 
assert_eq!(start - 6_u64, Month::July); 
assert_eq!(start - 7_u64, Month::June); 
assert_eq!(start - 8_u64, Month::May); 
assert_eq!(start - 9_u64, Month::April); 
assert_eq!(start - 10_u64, Month::March); 
assert_eq!(start - 11_u64, Month::February); 
assert_eq!(start - 12_u64, Month::January); // Wrap.
assert_eq!(start - 13_u64, Month::December); // Wrap.
assert_eq!(start - 14_u64, Month::November); // Wrap.
// …
Source§

type Output = Month

The resulting type after applying the - operator.
Source§

impl Sub<u8> for Month

Source§

fn sub(self, other: u8) -> Self

§Wrapping u8 Subtraction.

Months range from 1..=12, starting with January.

§Examples
use utc2k::Month;

let start = Month::January;
assert_eq!(start - 0_u8, Month::January); // Noop.
assert_eq!(start - 1_u8, Month::December); 
assert_eq!(start - 2_u8, Month::November); 
assert_eq!(start - 3_u8, Month::October); 
assert_eq!(start - 4_u8, Month::September); 
assert_eq!(start - 5_u8, Month::August); 
assert_eq!(start - 6_u8, Month::July); 
assert_eq!(start - 7_u8, Month::June); 
assert_eq!(start - 8_u8, Month::May); 
assert_eq!(start - 9_u8, Month::April); 
assert_eq!(start - 10_u8, Month::March); 
assert_eq!(start - 11_u8, Month::February); 
assert_eq!(start - 12_u8, Month::January); // Wrap.
assert_eq!(start - 13_u8, Month::December); // Wrap.
assert_eq!(start - 14_u8, Month::November); // Wrap.
// …
Source§

type Output = Month

The resulting type after applying the - operator.
Source§

impl Sub<usize> for Month

Source§

fn sub(self, other: usize) -> Self

§Wrapping usize Subtraction.

Months range from 1..=12, starting with January.

§Examples
use utc2k::Month;

let start = Month::January;
assert_eq!(start - 0_usize, Month::January); // Noop.
assert_eq!(start - 1_usize, Month::December); 
assert_eq!(start - 2_usize, Month::November); 
assert_eq!(start - 3_usize, Month::October); 
assert_eq!(start - 4_usize, Month::September); 
assert_eq!(start - 5_usize, Month::August); 
assert_eq!(start - 6_usize, Month::July); 
assert_eq!(start - 7_usize, Month::June); 
assert_eq!(start - 8_usize, Month::May); 
assert_eq!(start - 9_usize, Month::April); 
assert_eq!(start - 10_usize, Month::March); 
assert_eq!(start - 11_usize, Month::February); 
assert_eq!(start - 12_usize, Month::January); // Wrap.
assert_eq!(start - 13_usize, Month::December); // Wrap.
assert_eq!(start - 14_usize, Month::November); // Wrap.
// …
Source§

type Output = Month

The resulting type after applying the - operator.
Source§

impl SubAssign<u16> for Month

Source§

fn sub_assign(&mut self, other: u16)

Performs the -= operation. Read more
Source§

impl SubAssign<u32> for Month

Source§

fn sub_assign(&mut self, other: u32)

Performs the -= operation. Read more
Source§

impl SubAssign<u64> for Month

Source§

fn sub_assign(&mut self, other: u64)

Performs the -= operation. Read more
Source§

impl SubAssign<u8> for Month

Source§

fn sub_assign(&mut self, other: u8)

Performs the -= operation. Read more
Source§

impl SubAssign<usize> for Month

Source§

fn sub_assign(&mut self, other: usize)

Performs the -= operation. Read more
Source§

impl TryFrom<&[u8]> for Month

Source§

fn try_from(src: &[u8]) -> Result<Self, Self::Error>

§From Byte Slice.

Parse a Month from the first three bytes of a slice, case-insensitively.

§Examples
use utc2k::Month;

// Case doesn't matter.
assert_eq!(
    Month::try_from(b"january".as_slice()),
    Ok(Month::January),
);
assert_eq!(
    Month::try_from(b"January".as_slice()),
    Ok(Month::January),
);
assert_eq!(
    Month::try_from(b"JANUARY".as_slice()),
    Ok(Month::January),
);

// Only the first three bytes are actually inspected.
assert_eq!(
    Month::try_from(b"Jan".as_slice()),
    Ok(Month::January),
);
assert_eq!(
    Month::try_from(b"janissary".as_slice()), // Close enough!
    Ok(Month::January),
);

// Wrong is wrong.
assert!(Month::try_from(b"jebruary".as_slice()).is_err());
Source§

type Error = Utc2kError

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

impl TryFrom<&Box<str>> for Month

Source§

type Error = Utc2kError

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

fn try_from(src: &Box<str>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Cow<'_, str>> for Month

Source§

type Error = Utc2kError

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

fn try_from(src: &Cow<'_, str>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&String> for Month

Source§

type Error = Utc2kError

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

fn try_from(src: &String) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&str> for Month

Source§

type Error = Utc2kError

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

fn try_from(src: &str) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Box<str>> for Month

Source§

type Error = Utc2kError

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

fn try_from(src: Box<str>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Cow<'_, str>> for Month

Source§

type Error = Utc2kError

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

fn try_from(src: Cow<'_, str>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<String> for Month

Source§

type Error = Utc2kError

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

fn try_from(src: String) -> 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 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<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

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

Compare self to key and return their ordering.
Source§

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

Source§

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

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

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

Source§

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

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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

Source§

impl<T> ErasedDestructor for T
where T: 'static,