Struct Cycle
#[must_use = "iterators are lazy and do nothing unless consumed"]
pub struct Cycle<I> { pub(in ::iter::adapters::cycle) orig: I, pub(in ::iter::adapters::cycle) iter: I }
An iterator that repeats endlessly.
This struct is created by the cycle method on Iterator. See its
documentation for more.
Fields
orig: Iiter: I
Implementations
impl<I: ~const Clone> Cycle<I>
const fn new(iter: I) -> Cycle<I>
Trait Implementations
impl<I> FusedIterator for Cycle<I>
where
I: Clone + Iterator,
impl<I> Iterator for Cycle<I>
where
I: Clone + Iterator,
type Item = <I as Iterator>::Item;fn next(&mut self) -> Option<<I as Iterator>::Item>fn size_hint(&self) -> (usize, Option<usize>)fn try_fold<Acc, F, R>(&mut self, acc: Acc, f: F) -> R where F: FnMut(Acc, Self::Item) -> R, R: Try<Output = Acc>,fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
impl<I: Clone> Clone for Cycle<I>
fn clone(&self) -> Cycle<I>
impl<I: Debug> Debug for Cycle<I>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl<I> Freeze for Cycle<I>
where
I: Freeze + Freeze,
impl<I> RefUnwindSafe for Cycle<I>
where
I: RefUnwindSafe + RefUnwindSafe,
impl<I> Send for Cycle<I>
where
I: Send + Send,
impl<I> Sync for Cycle<I>
where
I: Sync + Sync,
impl<I> Unpin for Cycle<I>
where
I: Unpin + Unpin,
impl<I> UnsafeUnpin for Cycle<I>
where
I: UnsafeUnpin + UnsafeUnpin,
impl<I> UnwindSafe for Cycle<I>
where
I: UnwindSafe + UnwindSafe,
Blanket Implementations
impl<I> IntoIterator for Cycle<I>
where
I: Iterator,
type Item = <I as Iterator>::Item;type IntoIter = I;fn into_iter(self) -> I
impl<T> Any for Cycle<I>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Cycle<I>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Cycle<I>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Cycle<I>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Cycle<I>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> SizeHint for Cycle<I>
where
T: ?Sized,
fn lower_bound(&self) -> usizefn upper_bound(&self) -> Option<usize>
impl<T> SizedTypeProperties for Cycle<I>
impl<T, U> Into<U> for Cycle<I>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Cycle<I>
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 Cycle<I>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>