Struct WeekdayIter

pub struct WeekdayIter { /* private fields */ }

An infinite iterator over Weekdays.

This struct is created by Weekday::iter_from or WeekdayIter::new.

Implementations

impl WeekdayIter

const fn new(start: Weekday) -> Self

Create a new WeekdayIter starting at start.

# use time::{Weekday, iter::WeekdayIter};
let mut iter = WeekdayIter::new(Weekday::Monday);
assert_eq!(iter.next(), Some(Weekday::Monday));
assert_eq!(iter.next(), Some(Weekday::Tuesday));
assert_eq!(iter.next(), Some(Weekday::Wednesday));
const fn rev(self) -> Rev<Self>

Make the iterator go in reverse order.

# use time::{Weekday, iter::WeekdayIter};
let mut iter = WeekdayIter::new(Weekday::Monday).rev();
assert_eq!(iter.next(), Some(Weekday::Monday));
assert_eq!(iter.next(), Some(Weekday::Sunday));
assert_eq!(iter.next(), Some(Weekday::Saturday));

Trait Implementations

impl Clone for WeekdayIter

fn clone(&self) -> WeekdayIter

impl Debug for WeekdayIter

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

impl Eq for WeekdayIter

impl FusedIterator for WeekdayIter

impl Iterator for WeekdayIter

type Item = Weekday;
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,

impl PartialEq for WeekdayIter

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

impl StructuralPartialEq for WeekdayIter

Auto Trait Implementations

impl Freeze for WeekdayIter

impl RefUnwindSafe for WeekdayIter

impl Send for WeekdayIter

impl Sync for WeekdayIter

impl Unpin for WeekdayIter

impl UnsafeUnpin for WeekdayIter

impl UnwindSafe for WeekdayIter

Blanket Implementations

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

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

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

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

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

impl<T> From<T> for WeekdayIter

fn from(t: T) -> T

Returns the argument unchanged.

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

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

impl<T, U> Into<U> for WeekdayIter 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 WeekdayIter where U: Into<T>,

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

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

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