pub struct Filter<I, P> { /* private fields */ }Expand description
An adapter for filtering items in an OutputIterator.
This is created by the filter method on OutputIterator. See its documentation for more.
Trait Implementations§
Source§impl<I, P> OutputIterator for Filter<I, P>
impl<I, P> OutputIterator for Filter<I, P>
Source§type Item = <I as OutputIterator>::Item
type Item = <I as OutputIterator>::Item
The type of items yielded by this iterator.
Source§type Output = <I as OutputIterator>::Output
type Output = <I as OutputIterator>::Output
The type of the intermediate output produced by this iterator.
Source§type AfterOutput = Filter<<I as OutputIterator>::AfterOutput, P>
type AfterOutput = Filter<<I as OutputIterator>::AfterOutput, P>
The type of the iterator after the intermediate output is produced.
Source§fn next(self) -> OutputIteratorVariant<Self>
fn next(self) -> OutputIteratorVariant<Self>
Advances the iterator, returning either the next item or the intermediate output. Read more
Source§fn into_iter(self, buf: &mut Self::Output) -> IntoIter<'_, Self> ⓘ
fn into_iter(self, buf: &mut Self::Output) -> IntoIter<'_, Self> ⓘ
Converts this
OutputIterator into a standard iterator, using a mutable buffer
to store the intermediate output.
Upon completion, output buffer will be overridden with the output of the iterator.Source§fn into_iter_option(
self,
buf: &mut Option<Self::Output>,
) -> IntoIterOption<'_, Self> ⓘ
fn into_iter_option( self, buf: &mut Option<Self::Output>, ) -> IntoIterOption<'_, Self> ⓘ
Converts this
OutputIterator into an iterator, and a reference to the optional buffer.
At the moment of creation, the buffer will be None, and upon completion it will be Some with output of the iterator.Source§fn ignore_output(self) -> IgnoreOutput<Self> ⓘ
fn ignore_output(self) -> IgnoreOutput<Self> ⓘ
Converts this
OutputIterator into an iterator that ignores the intermediate output.Source§fn until_output(
self,
f: impl FnMut(Self::Item),
) -> (Self::AfterOutput, Self::Output)
fn until_output( self, f: impl FnMut(Self::Item), ) -> (Self::AfterOutput, Self::Output)
Processes items until the intermediate output is encountered, calling closure for each yielded item.
Source§fn until_output_iter<F>(self, f: F) -> (Self::AfterOutput, Self::Output)where
F: FnOnce(&mut UntilOutput<Self>),
fn until_output_iter<F>(self, f: F) -> (Self::AfterOutput, Self::Output)where
F: FnOnce(&mut UntilOutput<Self>),
Similar to
until_output, but instead gives an iterator when it is more convenient to use it.
Iterator only yields items until the intermediate output has been received, and no more.Source§fn foreach(self, f: impl FnMut(Self::Item)) -> Self::Output
fn foreach(self, f: impl FnMut(Self::Item)) -> Self::Output
Iterates over all items, applying a closure to each item. Returns produced output.
Source§fn map_output<B, F>(self, f: F) -> MapOutput<Self, F>
fn map_output<B, F>(self, f: F) -> MapOutput<Self, F>
Maps the intermediate output using the provided function.
Auto Trait Implementations§
impl<I, P> Freeze for Filter<I, P>
impl<I, P> RefUnwindSafe for Filter<I, P>where
I: RefUnwindSafe,
P: RefUnwindSafe,
impl<I, P> Send for Filter<I, P>
impl<I, P> Sync for Filter<I, P>
impl<I, P> Unpin for Filter<I, P>
impl<I, P> UnwindSafe for Filter<I, P>where
I: UnwindSafe,
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