pub struct CloneIterator<I>(/* private fields */);
Expand description
Specialized helper struct to allow adapting any Iterator
into a Join
.
Join
requires the underlying object to be &T: IntoIterator
, so that
it can be iterated over when formatting via Display
. This works fine for
collection types like Vec
,
but it doesn’t work for arbitrary iterators. However, because many iterators
are cheaply clonable (because they often just contain a reference to the
underlying sequence), we can use this adapter to create an &T: IntoIterator
type which can be displayed by Join
.
Trait Implementations§
Source§impl<I: Clone> Clone for CloneIterator<I>
impl<I: Clone> Clone for CloneIterator<I>
Source§fn clone(&self) -> CloneIterator<I>
fn clone(&self) -> CloneIterator<I>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<I: Debug> Debug for CloneIterator<I>
impl<I: Debug> Debug for CloneIterator<I>
Source§impl<'a, I: Iterator + Clone> IntoIterator for &'a CloneIterator<I>
impl<'a, I: Iterator + Clone> IntoIterator for &'a CloneIterator<I>
Source§impl<I: Iterator> IntoIterator for CloneIterator<I>
impl<I: Iterator> IntoIterator for CloneIterator<I>
Source§impl<I: PartialEq> PartialEq for CloneIterator<I>
impl<I: PartialEq> PartialEq for CloneIterator<I>
impl<I: Eq> Eq for CloneIterator<I>
impl<I> StructuralPartialEq for CloneIterator<I>
Auto Trait Implementations§
impl<I> Freeze for CloneIterator<I>where
I: Freeze,
impl<I> RefUnwindSafe for CloneIterator<I>where
I: RefUnwindSafe,
impl<I> Send for CloneIterator<I>where
I: Send,
impl<I> Sync for CloneIterator<I>where
I: Sync,
impl<I> Unpin for CloneIterator<I>where
I: Unpin,
impl<I> UnwindSafe for CloneIterator<I>where
I: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Joinable for Twhere
&'a T: for<'a> IntoIterator,
impl<T> Joinable for Twhere
&'a T: for<'a> IntoIterator,
type Collection = T
Source§fn join_concat(self) -> Join<Self::Collection, NoSeparator>
fn join_concat(self) -> Join<Self::Collection, NoSeparator>
Join this object with an empty separator. When rendered
with
Display
, the underlying elements will be directly concatenated.
Note that the separator, while empty, is still present, and will show
up if you iterate this instance. Read more