Trait streamtools::StreamTools
source · pub trait StreamTools: Stream {
// Provided methods
fn fast_forward(self) -> FastForward<Self>
where Self: Sized { ... }
fn flatten_switch(self) -> FlattenSwitch<Self>
where Self::Item: Stream,
Self: Sized { ... }
fn sample<S: Stream>(self, sampler: S) -> Sample<Self, S>
where Self: Sized { ... }
}Expand description
An extension trait for the Stream trait that provides a variety of
convenient combinator functions.
Provided Methods§
sourcefn fast_forward(self) -> FastForward<Self>where
Self: Sized,
fn fast_forward(self) -> FastForward<Self>where Self: Sized,
Fast-forwards to the latest value on the underlying stream by polling the underyling until it is Pending.
When the underlying stream terminates, this stream will yield the last value on the underlying stream, if it has not already been yielded.
This behaves like a WatchStream but can be applied to arbitrary streams without requiring a channel.