Struct IntersperseWith

pub struct IntersperseWith<I, G>
where
    I: Iterator, { pub(in ::iter::adapters::intersperse) started: bool, pub(in ::iter::adapters::intersperse) separator: G, pub(in ::iter::adapters::intersperse) next_item: Option<I::Item>, pub(in ::iter::adapters::intersperse) iter: I }

An iterator adapter that places a separator between all elements.

This struct is created by Iterator::intersperse_with. See its documentation for more information.

Fields

started: bool
separator: G
next_item: Option<I::Item>
iter: I

Implementations

impl<I, G> IntersperseWith<I, G> where I: Iterator, G: FnMut() -> I::Item,

const fn new(iter: I, separator: G) -> Self

Trait Implementations

impl<I, G> Clone for IntersperseWith<I, G> where I: Iterator + Clone, I::Item: Clone, G: Clone,

fn clone(&self) -> Self

impl<I, G> Debug for IntersperseWith<I, G> where I: Iterator + Debug, I::Item: Debug, G: Debug,

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

impl<I, G> Iterator for IntersperseWith<I, G> where I: Iterator, G: FnMut() -> I::Item,

type Item = <I as Iterator>::Item;
fn next(&mut self) -> Option<Self::Item>
fn size_hint(&self) -> (usize, Option<usize>)
fn fold<B, F>(self, init: B, f: F) -> B
where
    Self: Sized,
    F: FnMut(B, Self::Item) -> B,

Auto Trait Implementations

impl<I, G> Freeze for IntersperseWith<I, G> where G: Freeze, Option<<I as Iterator>::Item>: Freeze, I: Freeze,

impl<I, G> RefUnwindSafe for IntersperseWith<I, G> where G: RefUnwindSafe, Option<<I as Iterator>::Item>: RefUnwindSafe, I: RefUnwindSafe,

impl<I, G> Send for IntersperseWith<I, G> where G: Send, Option<<I as Iterator>::Item>: Send, I: Send,

impl<I, G> Sync for IntersperseWith<I, G> where G: Sync, Option<<I as Iterator>::Item>: Sync, I: Sync,

impl<I, G> Unpin for IntersperseWith<I, G> where G: Unpin, Option<<I as Iterator>::Item>: Unpin, I: Unpin,

impl<I, G> UnsafeUnpin for IntersperseWith<I, G> where G: UnsafeUnpin, Option<<I as Iterator>::Item>: UnsafeUnpin, I: UnsafeUnpin,

impl<I, G> UnwindSafe for IntersperseWith<I, G> where G: UnwindSafe, Option<<I as Iterator>::Item>: UnwindSafe, I: UnwindSafe,

Blanket Implementations

impl<I> IntoIterator for IntersperseWith<I, G> where I: Iterator,

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

impl<T> Any for IntersperseWith<I, G> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for IntersperseWith<I, G> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for IntersperseWith<I, G> where T: ?Sized,

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

impl<T> CloneToUninit for IntersperseWith<I, G> where T: Clone,

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

impl<T> From<T> for IntersperseWith<I, G>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> SizeHint for IntersperseWith<I, G> where T: ?Sized,

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

impl<T> SizedTypeProperties for IntersperseWith<I, G>

impl<T, U> Into<U> for IntersperseWith<I, G> 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 IntersperseWith<I, G> 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 IntersperseWith<I, G> where U: TryFrom<T>,

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