Struct futures::stream::Filter [−][src]
#[must_use = "streams do nothing unless polled"]pub struct Filter<St, Fut, F> where
F: FnMut(&<St as Stream>::Item) -> Fut,
Fut: Future<Output = bool>,
St: Stream, { /* fields omitted */ }
A stream combinator used to filter the results of a stream and only yield some values.
This structure is produced by the Stream::filter
method.
Methods
impl<St, Fut, F> Filter<St, Fut, F> where
F: FnMut(&<St as Stream>::Item) -> Fut,
Fut: Future<Output = bool>,
St: Stream,
[src]
impl<St, Fut, F> Filter<St, Fut, F> where
F: FnMut(&<St as Stream>::Item) -> Fut,
Fut: Future<Output = bool>,
St: Stream,
ⓘImportant traits for &'a mut Ipub fn get_ref(&self) -> &St
[src]
pub fn get_ref(&self) -> &St
Acquires a reference to the underlying stream that this combinator is pulling from.
ⓘImportant traits for &'a mut Ipub fn get_mut(&mut self) -> &mut St
[src]
pub fn get_mut(&mut self) -> &mut St
Acquires a mutable reference to the underlying stream that this combinator is pulling from.
Note that care must be taken to avoid tampering with the state of the stream which may otherwise confuse this combinator.
pub fn into_inner(self) -> St
[src]
pub fn into_inner(self) -> St
Consumes this combinator, returning the underlying stream.
Note that this may discard intermediate state of this combinator, so care should be taken to avoid losing resources when this is called.
Trait Implementations
impl<St, Fut, F> Unpin for Filter<St, Fut, F> where
F: FnMut(&<St as Stream>::Item) -> Fut,
Fut: Future<Output = bool> + Unpin,
St: Stream + Unpin,
[src]
impl<St, Fut, F> Unpin for Filter<St, Fut, F> where
F: FnMut(&<St as Stream>::Item) -> Fut,
Fut: Future<Output = bool> + Unpin,
St: Stream + Unpin,
impl<St, Fut, F> Debug for Filter<St, Fut, F> where
F: Debug + FnMut(&<St as Stream>::Item) -> Fut,
Fut: Debug + Future<Output = bool>,
St: Stream + Debug,
<St as Stream>::Item: Debug,
[src]
impl<St, Fut, F> Debug for Filter<St, Fut, F> where
F: Debug + FnMut(&<St as Stream>::Item) -> Fut,
Fut: Debug + Future<Output = bool>,
St: Stream + Debug,
<St as Stream>::Item: Debug,
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<St, Fut, F> Stream for Filter<St, Fut, F> where
F: FnMut(&<St as Stream>::Item) -> Fut,
Fut: Future<Output = bool>,
St: Stream,
[src]
impl<St, Fut, F> Stream for Filter<St, Fut, F> where
F: FnMut(&<St as Stream>::Item) -> Fut,
Fut: Future<Output = bool>,
St: Stream,
type Item = <St as Stream>::Item
Values yielded by the stream.
fn poll_next(
self: PinMut<Filter<St, Fut, F>>,
cx: &mut Context
) -> Poll<Option<<St as Stream>::Item>>
[src]
fn poll_next(
self: PinMut<Filter<St, Fut, F>>,
cx: &mut Context
) -> Poll<Option<<St as Stream>::Item>>
Attempt to pull out the next value of this stream, registering the current task for wakeup if the value is not yet available, and returning None
if the stream is exhausted. Read more