Struct futures_util::stream::BufferUnordered [−][src]
#[must_use = "streams do nothing unless polled"]pub struct BufferUnordered<St> where
St: Stream,
St::Item: Future, { /* fields omitted */ }
An adaptor for a stream of futures to execute the futures concurrently, if possible, delivering results as they become available.
This adaptor will buffer up a list of pending futures, and then return their
results in the order that they complete. This is created by the
Stream::buffer_unordered
method.
Methods
impl<St> BufferUnordered<St> where
St: Stream,
St::Item: Future,
[src]
impl<St> BufferUnordered<St> where
St: Stream,
St::Item: Future,
ⓘImportant traits for &'a mut Wpub 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 Wpub 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 get_pin_mut<'a>(self: PinMut<'a, Self>) -> PinMut<'a, St>
[src]
pub fn get_pin_mut<'a>(self: PinMut<'a, Self>) -> PinMut<'a, St>
Acquires a pinned 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> Unpin for BufferUnordered<St> where
St: Stream + Unpin,
St::Item: Future,
[src]
impl<St> Unpin for BufferUnordered<St> where
St: Stream + Unpin,
St::Item: Future,
impl<St> Debug for BufferUnordered<St> where
St: Stream + Debug,
St::Item: Future,
[src]
impl<St> Debug for BufferUnordered<St> where
St: Stream + Debug,
St::Item: Future,
fn fmt(&self, fmt: &mut Formatter) -> Result
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<St> Stream for BufferUnordered<St> where
St: Stream,
St::Item: Future,
[src]
impl<St> Stream for BufferUnordered<St> where
St: Stream,
St::Item: Future,
type Item = <St::Item as Future>::Output
Values yielded by the stream.
fn poll_next(self: PinMut<Self>, cx: &mut Context) -> Poll<Option<Self::Item>>
[src]
fn poll_next(self: PinMut<Self>, cx: &mut Context) -> Poll<Option<Self::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
impl<S> Sink for BufferUnordered<S> where
S: Stream + Sink,
S::Item: Future,
[src]
impl<S> Sink for BufferUnordered<S> where
S: Stream + Sink,
S::Item: Future,
type SinkItem = S::SinkItem
The type of value that the sink accepts.
type SinkError = S::SinkError
The type of value produced by the sink when an error occurs.
fn poll_ready(
self: PinMut<Self>,
cx: &mut Context
) -> Poll<Result<(), Self::SinkError>>
[src]
fn poll_ready(
self: PinMut<Self>,
cx: &mut Context
) -> Poll<Result<(), Self::SinkError>>
Attempts to prepare the Sink
to receive a value. Read more
fn start_send(
self: PinMut<Self>,
item: Self::SinkItem
) -> Result<(), Self::SinkError>
[src]
fn start_send(
self: PinMut<Self>,
item: Self::SinkItem
) -> Result<(), Self::SinkError>
Begin the process of sending a value to the sink. Each call to this function must be proceeded by a successful call to poll_ready
which returned Ok(Poll::Ready(()))
. Read more
fn poll_flush(
self: PinMut<Self>,
cx: &mut Context
) -> Poll<Result<(), Self::SinkError>>
[src]
fn poll_flush(
self: PinMut<Self>,
cx: &mut Context
) -> Poll<Result<(), Self::SinkError>>
Flush any remaining output from this sink. Read more
fn poll_close(
self: PinMut<Self>,
cx: &mut Context
) -> Poll<Result<(), Self::SinkError>>
[src]
fn poll_close(
self: PinMut<Self>,
cx: &mut Context
) -> Poll<Result<(), Self::SinkError>>
Flush any remaining output and close this sink, if necessary. Read more