pub struct IterInput<I>where
I: Iterator,{ /* private fields */ }Expand description
An input adapter that wraps any iterator and provides TryNext and
TryNextWithContext<C> interface, automatically fusing the iterator
so it never yields items after returning None once.
§Type Parameters
I: The underlying iterator type. It can be anyIterator.C: The context type, which is passed by mutable reference to eachtry_next_with_contextcall.
Implementations§
Trait Implementations§
Source§impl<I> TryNext for IterInput<I>where
I: Iterator,
impl<I> TryNext for IterInput<I>where
I: Iterator,
Source§type Error = Infallible
type Error = Infallible
The error type that may be returned when producing the next item fails.
Source§fn try_next(&mut self) -> Result<Option<Self::Item>, Self::Error>
fn try_next(&mut self) -> Result<Option<Self::Item>, Self::Error>
Attempts to produce the next item from the source. Read more
fn stats(&self) -> S
Source§impl<I, C> TryNextWithContext<C> for IterInput<I>where
I: Iterator,
impl<I, C> TryNextWithContext<C> for IterInput<I>where
I: Iterator,
Source§type Error = Infallible
type Error = Infallible
The error type that may be returned when producing the next item fails.
Source§fn try_next_with_context(
&mut self,
_context: &mut C,
) -> Result<Option<Self::Item>, Self::Error>
fn try_next_with_context( &mut self, _context: &mut C, ) -> Result<Option<Self::Item>, Self::Error>
Attempts to produce the next item, using the provided mutable context. Read more
Source§fn try_collect_with_context(
&mut self,
context: &mut C,
) -> Result<Vec<Self::Item>, Self::Error>
fn try_collect_with_context( &mut self, context: &mut C, ) -> Result<Vec<Self::Item>, Self::Error>
fn stats(&self) -> S
Auto Trait Implementations§
impl<I> Freeze for IterInput<I>where
I: Freeze,
impl<I> RefUnwindSafe for IterInput<I>where
I: RefUnwindSafe,
impl<I> Send for IterInput<I>where
I: Send,
impl<I> Sync for IterInput<I>where
I: Sync,
impl<I> Unpin for IterInput<I>where
I: Unpin,
impl<I> UnwindSafe for IterInput<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