Trait futures_ext::stream::FbStreamExt
source · pub trait FbStreamExt: Stream {
// Provided methods
fn return_remainder(
self
) -> (ReturnRemainder<Self>, ConservativeReceiver<Self>)
where Self: Sized { ... }
fn buffered_weight_limited<'a, I, Fut>(
self,
params: BufferedParams
) -> WeightLimitedBufferedStream<'a, Self, I>
where Self: Sized + Send + 'a + Stream<Item = (Fut, u64)>,
Fut: Future<Output = I> { ... }
fn whole_stream_timeout(self, timeout: Duration) -> StreamWithTimeout<Self>
where Self: Sized { ... }
fn yield_periodically(self) -> YieldPeriodically<Self>
where Self: Sized { ... }
}
Expand description
A trait implemented by default for all Streams which extends the standard functionality.
Provided Methods§
sourcefn return_remainder(self) -> (ReturnRemainder<Self>, ConservativeReceiver<Self>)where
Self: Sized,
fn return_remainder(self) -> (ReturnRemainder<Self>, ConservativeReceiver<Self>)where
Self: Sized,
Creates a stream wrapper and a future. The future will resolve into the wrapped stream when the stream wrapper returns None. It uses ConservativeReceiver to ensure that deadlocks are easily caught when one tries to poll on the receiver before consuming the stream.
sourcefn buffered_weight_limited<'a, I, Fut>(
self,
params: BufferedParams
) -> WeightLimitedBufferedStream<'a, Self, I>
fn buffered_weight_limited<'a, I, Fut>( self, params: BufferedParams ) -> WeightLimitedBufferedStream<'a, Self, I>
Like [futures::stream::StreamExt::buffered] call, but can also limit number of futures in a buffer by “weight”.
sourcefn whole_stream_timeout(self, timeout: Duration) -> StreamWithTimeout<Self>where
Self: Sized,
fn whole_stream_timeout(self, timeout: Duration) -> StreamWithTimeout<Self>where
Self: Sized,
Construct a new self::stream_with_timeout::StreamWithTimeout.
sourcefn yield_periodically(self) -> YieldPeriodically<Self>where
Self: Sized,
fn yield_periodically(self) -> YieldPeriodically<Self>where
Self: Sized,
Construct a new self::yield_periodically::YieldPeriodically, with a sensible default.