Struct RepeatWith

pub struct RepeatWith<F> { pub(in ::iter::sources::repeat_with) repeater: F }

An iterator that repeats elements of type A endlessly by applying the provided closure F: FnMut() -> A.

This struct is created by the [repeat_with()] function. See its documentation for more.

Fields

repeater: F

Trait Implementations

impl<A, F: FnMut() -> A> FusedIterator for RepeatWith<F>

impl<A, F: FnMut() -> A> Iterator for RepeatWith<F>

type Item = A;
fn next(&mut self) -> Option<A>
fn size_hint(&self) -> (usize, Option<usize>)
fn try_fold<Acc, Fold, R>(&mut self, init: Acc, fold: Fold) -> R
where
    Fold: FnMut(Acc, Self::Item) -> R,
    R: Try<Output = Acc>,

impl<A, F: FnMut() -> A> TrustedLen for RepeatWith<F>

impl<F> Debug for RepeatWith<F>

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

impl<F: Clone> Clone for RepeatWith<F>

fn clone(&self) -> RepeatWith<F>

impl<F: Copy> Copy for RepeatWith<F>

Auto Trait Implementations

impl<F> Freeze for RepeatWith<F> where F: Freeze,

impl<F> RefUnwindSafe for RepeatWith<F> where F: RefUnwindSafe,

impl<F> Send for RepeatWith<F> where F: Send,

impl<F> Sync for RepeatWith<F> where F: Sync,

impl<F> Unpin for RepeatWith<F> where F: Unpin,

impl<F> UnsafeUnpin for RepeatWith<F> where F: UnsafeUnpin,

impl<F> UnwindSafe for RepeatWith<F> where F: UnwindSafe,

Blanket Implementations

impl<I> IntoIterator for RepeatWith<F> where I: Iterator,

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

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

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for RepeatWith<F> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for RepeatWith<F> where T: ?Sized,

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

impl<T> CloneToUninit for RepeatWith<F> where T: Clone,

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

impl<T> From<T> for RepeatWith<F>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Printable for RepeatWith<F> where T: Copy + Debug,

impl<T> SizeHint for RepeatWith<F> where T: ?Sized,

fn lower_bound(&self) -> usize
fn upper_bound(&self) -> Option<usize>

impl<T> SizedTypeProperties for RepeatWith<F>

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

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

impl<T, U> TryInto<U> for RepeatWith<F> where U: TryFrom<T>,

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