pub struct Enumerate<P>where
P: Pipe,{ /* private fields */ }
Expand description
A pipe that enumerates the output items of another pipe.
The inputs of this pipe are the same as the wrapped ones, but it’s output item is a tuple of an index and the wrapped pipe’s output. The index starts with zero and counts up for every produces output item.
For more information, please see the documentation of the enumerate
method.
Implementations§
Trait Implementations§
Source§impl<P: Pipe> Pipe for Enumerate<P>
impl<P: Pipe> Pipe for Enumerate<P>
Source§type OutputItem = (usize, <P as Pipe>::OutputItem)
type OutputItem = (usize, <P as Pipe>::OutputItem)
The type of output this pipe produces.
Source§fn next(&mut self, item: P::InputItem) -> (usize, P::OutputItem)
fn next(&mut self, item: P::InputItem) -> (usize, P::OutputItem)
Calculate the next output item, based on an input item.
Source§fn connect<O: Pipe<InputItem = Self::OutputItem>>(
self,
other: O,
) -> Connector<Self, O>where
Self: Sized,
fn connect<O: Pipe<InputItem = Self::OutputItem>>(
self,
other: O,
) -> Connector<Self, O>where
Self: Sized,
Connect two pipes. Read more
Source§impl<P: ResetablePipe> ResetablePipe for Enumerate<P>
impl<P: ResetablePipe> ResetablePipe for Enumerate<P>
Auto Trait Implementations§
impl<P> Freeze for Enumerate<P>where
P: Freeze,
impl<P> RefUnwindSafe for Enumerate<P>where
P: RefUnwindSafe,
impl<P> Send for Enumerate<P>where
P: Send,
impl<P> Sync for Enumerate<P>where
P: Sync,
impl<P> Unpin for Enumerate<P>where
P: Unpin,
impl<P> UnwindSafe for Enumerate<P>where
P: 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