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) -> Self

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: &Self) -> 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,

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

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

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

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

impl<T> From<T> for MonthIter

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

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

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

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