Struct MonthIter

pub struct MonthIter { /* private fields */ }

An infinite iterator over Months.

This struct is created by Month::iter_from or MonthIter::new.

Implementations

impl MonthIter

const fn new(start: Month) -> Self

Create a new MonthIter starting at start.

# use time::{Month, iter::MonthIter};
let mut iter = MonthIter::new(Month::January);
assert_eq!(iter.next(), Some(Month::January));
assert_eq!(iter.next(), Some(Month::February));
assert_eq!(iter.next(), Some(Month::March));
const fn rev(self) -> Rev<Self>

Make the iterator go in reverse order.

# use time::{Month, iter::MonthIter};
let mut iter = MonthIter::new(Month::January).rev();
assert_eq!(iter.next(), Some(Month::January));
assert_eq!(iter.next(), Some(Month::December));
assert_eq!(iter.next(), Some(Month::November));

Trait Implementations

impl Clone for MonthIter

fn clone(&self) -> MonthIter

impl Debug for MonthIter

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

impl Eq for MonthIter

impl FusedIterator for MonthIter

impl Iterator for MonthIter

type Item = Month;
fn next(&mut self) -> Option<Self::Item>
fn size_hint(&self) -> (usize, Option<usize>)
fn nth(&mut self, n: usize) -> Option<Self::Item>
fn count(self) -> usize
fn last(self) -> Option<Self::Item>
fn all<F>(&mut self, f: F) -> bool
where
    F: FnMut(Self::Item) -> bool,
fn any<F>(&mut self, f: F) -> bool
where
    F: FnMut(Self::Item) -> bool,
fn max(self) -> Option<Self::Item>
fn min(self) -> Option<Self::Item>
fn is_sorted(self) -> bool

impl PartialEq for MonthIter

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

impl StructuralPartialEq for MonthIter

Auto Trait Implementations

impl Freeze for MonthIter

impl RefUnwindSafe for MonthIter

impl Send for MonthIter

impl Sync for MonthIter

impl Unpin for MonthIter

impl UnsafeUnpin for MonthIter

impl UnwindSafe for MonthIter

Blanket Implementations

impl<I> IntoIterator for MonthIter where I: Iterator,

type Item = <I as Iterator>::Item;
type IntoIter = I;
fn into_iter(self) -> I

impl<T> Any for MonthIter where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

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

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

impl<T> From<T> for MonthIter

fn from(t: T) -> T

Returns the argument unchanged.

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

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

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

fn into(self) -> U

Calls U::from(self).

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

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

type Error = never;
fn try_from(value: U) -> Result<T, never>

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

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