Struct futures_util::future::Abortable
source · pub struct Abortable<T> { /* private fields */ }
Expand description
A future/stream which can be remotely short-circuited using an AbortHandle
.
Implementations§
source§impl<T> Abortable<T>
impl<T> Abortable<T>
sourcepub fn new(task: T, reg: AbortRegistration) -> Self
pub fn new(task: T, reg: AbortRegistration) -> Self
Creates a new Abortable
future/stream using an existing AbortRegistration
.
AbortRegistration
s can be acquired through AbortHandle::new
.
When abort
is called on the handle tied to reg
or if abort
has
already been called, the future/stream will complete immediately without making
any further progress.
§Examples:
Usage with futures:
use futures::future::{Abortable, AbortHandle, Aborted};
let (abort_handle, abort_registration) = AbortHandle::new_pair();
let future = Abortable::new(async { 2 }, abort_registration);
abort_handle.abort();
assert_eq!(future.await, Err(Aborted));
Usage with streams:
let (abort_handle, abort_registration) = AbortHandle::new_pair();
let mut stream = Abortable::new(stream::iter(vec![1, 2, 3]), abort_registration);
abort_handle.abort();
assert_eq!(stream.next().await, None);
sourcepub fn is_aborted(&self) -> bool
pub fn is_aborted(&self) -> bool
Checks whether the task has been aborted. Note that all this
method indicates is whether AbortHandle::abort
was called.
This means that it will return true
even if:
abort
was called after the task had completed.abort
was called while the task was being polled - the task may still be running and will not be stopped untilpoll
returns.
Trait Implementations§
source§impl<St> Stream for Abortable<St>where
St: Stream,
impl<St> Stream for Abortable<St>where
St: Stream,
impl<'__pin, T> Unpin for Abortable<T>where
PinnedFieldsOf<__Origin<'__pin, T>>: Unpin,
Auto Trait Implementations§
impl<T> Freeze for Abortable<T>where
T: Freeze,
impl<T> !RefUnwindSafe for Abortable<T>
impl<T> Send for Abortable<T>where
T: Send,
impl<T> Sync for Abortable<T>where
T: Sync,
impl<T> !UnwindSafe for Abortable<T>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn map<U, F>(self, f: F) -> Map<Self, F> ⓘ
fn map<U, F>(self, f: F) -> Map<Self, F> ⓘ
Map this future’s output to a different type, returning a new future of
the resulting type. Read more
source§fn map_into<U>(self) -> MapInto<Self, U> ⓘ
fn map_into<U>(self) -> MapInto<Self, U> ⓘ
Map this future’s output to a different type, returning a new future of
the resulting type. Read more
source§fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> ⓘ
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> ⓘ
Chain on a computation for when a future finished, passing the result of
the future to the provided closure
f
. Read moresource§fn left_future<B>(self) -> Either<Self, B> ⓘ
fn left_future<B>(self) -> Either<Self, B> ⓘ
source§fn right_future<A>(self) -> Either<A, Self> ⓘ
fn right_future<A>(self) -> Either<A, Self> ⓘ
source§fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
Convert this future into a single element stream. Read more
source§fn flatten(self) -> Flatten<Self> ⓘ
fn flatten(self) -> Flatten<Self> ⓘ
Flatten the execution of this future when the output of this
future is itself another future. Read more
source§fn flatten_stream(self) -> FlattenStream<Self>
fn flatten_stream(self) -> FlattenStream<Self>
Flatten the execution of this future when the successful result of this
future is a stream. Read more
source§fn fuse(self) -> Fuse<Self> ⓘwhere
Self: Sized,
fn fuse(self) -> Fuse<Self> ⓘwhere
Self: Sized,
Fuse a future such that
poll
will never again be called once it has
completed. This method can be used to turn any Future
into a
FusedFuture
. Read moresource§fn inspect<F>(self, f: F) -> Inspect<Self, F> ⓘ
fn inspect<F>(self, f: F) -> Inspect<Self, F> ⓘ
Do something with the output of a future before passing it on. Read more
source§fn catch_unwind(self) -> CatchUnwind<Self> ⓘwhere
Self: Sized + UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self> ⓘwhere
Self: Sized + UnwindSafe,
Catches unwinding panics while polling the future. Read more
Create a cloneable handle to this future where all handles will resolve
to the same result. Read more
source§fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)where
Self: Sized,
fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)where
Self: Sized,
Turn this future into a future that yields
()
on completion and sends
its output to another future on a separate task. Read moresource§fn boxed<'a>(self) -> BoxFuture<'a, Self::Output>
fn boxed<'a>(self) -> BoxFuture<'a, Self::Output>
Wrap the future in a Box, pinning it. Read more
source§fn boxed_local<'a>(self) -> LocalBoxFuture<'a, Self::Output>where
Self: Sized + 'a,
fn boxed_local<'a>(self) -> LocalBoxFuture<'a, Self::Output>where
Self: Sized + 'a,
Wrap the future in a Box, pinning it. Read more
source§fn unit_error(self) -> UnitError<Self> ⓘwhere
Self: Sized,
fn unit_error(self) -> UnitError<Self> ⓘwhere
Self: Sized,
Turns a
Future<Output = T>
into a
TryFuture<Ok = T, Error = ()
>.source§fn never_error(self) -> NeverError<Self> ⓘwhere
Self: Sized,
fn never_error(self) -> NeverError<Self> ⓘwhere
Self: Sized,
Turns a
Future<Output = T>
into a
TryFuture<Ok = T, Error = Never
>.source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more
source§impl<T> StreamExt for T
impl<T> StreamExt for T
source§fn next(&mut self) -> Next<'_, Self> ⓘwhere
Self: Unpin,
fn next(&mut self) -> Next<'_, Self> ⓘwhere
Self: Unpin,
Creates a future that resolves to the next item in the stream. Read more
source§fn into_future(self) -> StreamFuture<Self> ⓘ
fn into_future(self) -> StreamFuture<Self> ⓘ
source§fn map<T, F>(self, f: F) -> Map<Self, F>
fn map<T, F>(self, f: F) -> Map<Self, F>
Maps this stream’s items to a different type, returning a new stream of
the resulting type. Read more
source§fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
Creates a stream which gives the current iteration count as well as
the next value. Read more
source§fn filter<Fut, F>(self, f: F) -> Filter<Self, Fut, F>
fn filter<Fut, F>(self, f: F) -> Filter<Self, Fut, F>
Filters the values produced by this stream according to the provided
asynchronous predicate. Read more
source§fn filter_map<Fut, T, F>(self, f: F) -> FilterMap<Self, Fut, F>
fn filter_map<Fut, T, F>(self, f: F) -> FilterMap<Self, Fut, F>
Filters the values produced by this stream while simultaneously mapping
them to a different type according to the provided asynchronous closure. Read more
source§fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
Computes from this stream’s items new items of a different type using
an asynchronous closure. Read more
source§fn collect<C: Default + Extend<Self::Item>>(self) -> Collect<Self, C> ⓘwhere
Self: Sized,
fn collect<C: Default + Extend<Self::Item>>(self) -> Collect<Self, C> ⓘwhere
Self: Sized,
Transforms a stream into a collection, returning a
future representing the result of that computation. Read more
source§fn unzip<A, B, FromA, FromB>(self) -> Unzip<Self, FromA, FromB> ⓘ
fn unzip<A, B, FromA, FromB>(self) -> Unzip<Self, FromA, FromB> ⓘ
Converts a stream of pairs into a future, which
resolves to pair of containers. Read more
source§fn concat(self) -> Concat<Self> ⓘwhere
Self: Sized,
Self::Item: Extend<<<Self as Stream>::Item as IntoIterator>::Item> + IntoIterator + Default,
fn concat(self) -> Concat<Self> ⓘwhere
Self: Sized,
Self::Item: Extend<<<Self as Stream>::Item as IntoIterator>::Item> + IntoIterator + Default,
Concatenate all items of a stream into a single extendable
destination, returning a future representing the end result. Read more
source§fn count(self) -> Count<Self> ⓘwhere
Self: Sized,
fn count(self) -> Count<Self> ⓘwhere
Self: Sized,
Drives the stream to completion, counting the number of items. Read more
source§fn fold<T, Fut, F>(self, init: T, f: F) -> Fold<Self, Fut, T, F> ⓘ
fn fold<T, Fut, F>(self, init: T, f: F) -> Fold<Self, Fut, T, F> ⓘ
Execute an accumulating asynchronous computation over a stream,
collecting all the values into one final result. Read more
source§fn any<Fut, F>(self, f: F) -> Any<Self, Fut, F> ⓘ
fn any<Fut, F>(self, f: F) -> Any<Self, Fut, F> ⓘ
Execute predicate over asynchronous stream, and return
true
if any element in stream satisfied a predicate. Read moresource§fn all<Fut, F>(self, f: F) -> All<Self, Fut, F> ⓘ
fn all<Fut, F>(self, f: F) -> All<Self, Fut, F> ⓘ
Execute predicate over asynchronous stream, and return
true
if all element in stream satisfied a predicate. Read moresource§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Flattens a stream of streams into just one continuous stream. Read more
source§fn flatten_unordered(
self,
limit: impl Into<Option<usize>>,
) -> FlattenUnordered<Self>
fn flatten_unordered( self, limit: impl Into<Option<usize>>, ) -> FlattenUnordered<Self>
Flattens a stream of streams into just one continuous stream. Polls
inner streams produced by the base stream concurrently. Read more
source§fn flat_map_unordered<U, F>(
self,
limit: impl Into<Option<usize>>,
f: F,
) -> FlatMapUnordered<Self, U, F>
fn flat_map_unordered<U, F>( self, limit: impl Into<Option<usize>>, f: F, ) -> FlatMapUnordered<Self, U, F>
Maps a stream like
StreamExt::map
but flattens nested Stream
s
and polls them concurrently, yielding items in any order, as they made
available. Read moresource§fn scan<S, B, Fut, F>(self, initial_state: S, f: F) -> Scan<Self, S, Fut, F>
fn scan<S, B, Fut, F>(self, initial_state: S, f: F) -> Scan<Self, S, Fut, F>
Combinator similar to
StreamExt::fold
that holds internal state
and produces a new stream. Read moresource§fn skip_while<Fut, F>(self, f: F) -> SkipWhile<Self, Fut, F>
fn skip_while<Fut, F>(self, f: F) -> SkipWhile<Self, Fut, F>
Skip elements on this stream while the provided asynchronous predicate
resolves to
true
. Read moresource§fn take_while<Fut, F>(self, f: F) -> TakeWhile<Self, Fut, F>
fn take_while<Fut, F>(self, f: F) -> TakeWhile<Self, Fut, F>
Take elements from this stream while the provided asynchronous predicate
resolves to
true
. Read moresource§fn take_until<Fut>(self, fut: Fut) -> TakeUntil<Self, Fut>
fn take_until<Fut>(self, fut: Fut) -> TakeUntil<Self, Fut>
Take elements from this stream until the provided future resolves. Read more
source§fn for_each<Fut, F>(self, f: F) -> ForEach<Self, Fut, F> ⓘ
fn for_each<Fut, F>(self, f: F) -> ForEach<Self, Fut, F> ⓘ
Runs this stream to completion, executing the provided asynchronous
closure for each element on the stream. Read more
source§fn for_each_concurrent<Fut, F>(
self,
limit: impl Into<Option<usize>>,
f: F,
) -> ForEachConcurrent<Self, Fut, F> ⓘ
fn for_each_concurrent<Fut, F>( self, limit: impl Into<Option<usize>>, f: F, ) -> ForEachConcurrent<Self, Fut, F> ⓘ
Runs this stream to completion, executing the provided asynchronous
closure for each element on the stream concurrently as elements become
available. Read more
source§fn take(self, n: usize) -> Take<Self>where
Self: Sized,
fn take(self, n: usize) -> Take<Self>where
Self: Sized,
Creates a new stream of at most
n
items of the underlying stream. Read moresource§fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
Creates a new stream which skips
n
items of the underlying stream. Read moresource§fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
Catches unwinding panics while polling the stream. Read more
source§fn boxed<'a>(self) -> BoxStream<'a, Self::Item>
fn boxed<'a>(self) -> BoxStream<'a, Self::Item>
Wrap the stream in a Box, pinning it. Read more
source§fn boxed_local<'a>(self) -> LocalBoxStream<'a, Self::Item>where
Self: Sized + 'a,
fn boxed_local<'a>(self) -> LocalBoxStream<'a, Self::Item>where
Self: Sized + 'a,
Wrap the stream in a Box, pinning it. Read more
source§fn buffered(self, n: usize) -> Buffered<Self>
fn buffered(self, n: usize) -> Buffered<Self>
An adaptor for creating a buffered list of pending futures. Read more
source§fn buffer_unordered(self, n: usize) -> BufferUnordered<Self>
fn buffer_unordered(self, n: usize) -> BufferUnordered<Self>
An adaptor for creating a buffered list of pending futures (unordered). Read more
source§fn zip<St>(self, other: St) -> Zip<Self, St>
fn zip<St>(self, other: St) -> Zip<Self, St>
An adapter for zipping two streams together. Read more
source§fn peekable(self) -> Peekable<Self>where
Self: Sized,
fn peekable(self) -> Peekable<Self>where
Self: Sized,
Creates a new stream which exposes a
peek
method. Read moresource§fn chunks(self, capacity: usize) -> Chunks<Self>where
Self: Sized,
fn chunks(self, capacity: usize) -> Chunks<Self>where
Self: Sized,
An adaptor for chunking up items of the stream inside a vector. Read more
source§fn ready_chunks(self, capacity: usize) -> ReadyChunks<Self>where
Self: Sized,
fn ready_chunks(self, capacity: usize) -> ReadyChunks<Self>where
Self: Sized,
An adaptor for chunking up ready items of the stream inside a vector. Read more
source§fn forward<S>(self, sink: S) -> Forward<Self, S> ⓘ
fn forward<S>(self, sink: S) -> Forward<Self, S> ⓘ
A future that completes after the given stream has been fully processed
into the sink and the sink has been flushed and closed. Read more
source§fn split<Item>(self) -> (SplitSink<Self, Item>, SplitStream<Self>)
fn split<Item>(self) -> (SplitSink<Self, Item>, SplitStream<Self>)
source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
Do something with each item of this stream, afterwards passing it on. Read more
source§fn left_stream<B>(self) -> Either<Self, B> ⓘ
fn left_stream<B>(self) -> Either<Self, B> ⓘ
source§fn right_stream<B>(self) -> Either<B, Self> ⓘ
fn right_stream<B>(self) -> Either<B, Self> ⓘ
source§fn poll_next_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>where
Self: Unpin,
fn poll_next_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>where
Self: Unpin,
A convenience method for calling
Stream::poll_next
on Unpin
stream types.source§fn select_next_some(&mut self) -> SelectNextSome<'_, Self> ⓘwhere
Self: Unpin + FusedStream,
fn select_next_some(&mut self) -> SelectNextSome<'_, Self> ⓘwhere
Self: Unpin + FusedStream,
source§impl<Fut> TryFutureExt for Fut
impl<Fut> TryFutureExt for Fut
source§fn flatten_sink<Item>(self) -> FlattenSink<Self, Self::Ok>
fn flatten_sink<Item>(self) -> FlattenSink<Self, Self::Ok>
source§fn map_ok<T, F>(self, f: F) -> MapOk<Self, F> ⓘ
fn map_ok<T, F>(self, f: F) -> MapOk<Self, F> ⓘ
Maps this future’s success value to a different value. Read more
source§fn map_ok_or_else<T, E, F>(self, e: E, f: F) -> MapOkOrElse<Self, F, E> ⓘ
fn map_ok_or_else<T, E, F>(self, e: E, f: F) -> MapOkOrElse<Self, F, E> ⓘ
Maps this future’s success value to a different value, and permits for error handling resulting in the same type. Read more
source§fn map_err<E, F>(self, f: F) -> MapErr<Self, F> ⓘ
fn map_err<E, F>(self, f: F) -> MapErr<Self, F> ⓘ
Maps this future’s error value to a different value. Read more
source§fn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F> ⓘ
fn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F> ⓘ
Executes another future after this one resolves successfully. The
success value is passed to a closure to create this subsequent future. Read more
source§fn or_else<Fut, F>(self, f: F) -> OrElse<Self, Fut, F> ⓘ
fn or_else<Fut, F>(self, f: F) -> OrElse<Self, Fut, F> ⓘ
Executes another future if this one resolves to an error. The
error value is passed to a closure to create this subsequent future. Read more
source§fn inspect_ok<F>(self, f: F) -> InspectOk<Self, F> ⓘ
fn inspect_ok<F>(self, f: F) -> InspectOk<Self, F> ⓘ
Do something with the success value of a future before passing it on. Read more
source§fn inspect_err<F>(self, f: F) -> InspectErr<Self, F> ⓘ
fn inspect_err<F>(self, f: F) -> InspectErr<Self, F> ⓘ
Do something with the error value of a future before passing it on. Read more
source§fn try_flatten(self) -> TryFlatten<Self, Self::Ok> ⓘ
fn try_flatten(self) -> TryFlatten<Self, Self::Ok> ⓘ
Flatten the execution of this future when the successful result of this
future is another future. Read more
source§fn try_flatten_stream(self) -> TryFlattenStream<Self>
fn try_flatten_stream(self) -> TryFlattenStream<Self>
Flatten the execution of this future when the successful result of this
future is a stream. Read more
source§fn unwrap_or_else<F>(self, f: F) -> UnwrapOrElse<Self, F> ⓘ
fn unwrap_or_else<F>(self, f: F) -> UnwrapOrElse<Self, F> ⓘ
source§fn into_future(self) -> IntoFuture<Self> ⓘwhere
Self: Sized,
fn into_future(self) -> IntoFuture<Self> ⓘwhere
Self: Sized,
source§impl<S> TryStreamExt for S
impl<S> TryStreamExt for S
source§fn err_into<E>(self) -> ErrInto<Self, E>
fn err_into<E>(self) -> ErrInto<Self, E>
Wraps the current stream in a new stream which converts the error type
into the one provided. Read more
source§fn map_ok<T, F>(self, f: F) -> MapOk<Self, F>
fn map_ok<T, F>(self, f: F) -> MapOk<Self, F>
Wraps the current stream in a new stream which maps the success value
using the provided closure. Read more
source§fn map_err<E, F>(self, f: F) -> MapErr<Self, F>
fn map_err<E, F>(self, f: F) -> MapErr<Self, F>
Wraps the current stream in a new stream which maps the error value
using the provided closure. Read more
source§fn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F>
fn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F>
Chain on a computation for when a value is ready, passing the successful
results to the provided closure
f
. Read moresource§fn or_else<Fut, F>(self, f: F) -> OrElse<Self, Fut, F>
fn or_else<Fut, F>(self, f: F) -> OrElse<Self, Fut, F>
Chain on a computation for when an error happens, passing the
erroneous result to the provided closure
f
. Read moresource§fn inspect_ok<F>(self, f: F) -> InspectOk<Self, F>
fn inspect_ok<F>(self, f: F) -> InspectOk<Self, F>
Do something with the success value of this stream, afterwards passing
it on. Read more
source§fn inspect_err<F>(self, f: F) -> InspectErr<Self, F>
fn inspect_err<F>(self, f: F) -> InspectErr<Self, F>
Do something with the error value of this stream, afterwards passing it on. Read more
source§fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
source§fn try_next(&mut self) -> TryNext<'_, Self> ⓘwhere
Self: Unpin,
fn try_next(&mut self) -> TryNext<'_, Self> ⓘwhere
Self: Unpin,
Creates a future that attempts to resolve the next item in the stream.
If an error is encountered before the next item, the error is returned
instead. Read more
source§fn try_for_each<Fut, F>(self, f: F) -> TryForEach<Self, Fut, F> ⓘ
fn try_for_each<Fut, F>(self, f: F) -> TryForEach<Self, Fut, F> ⓘ
Attempts to run this stream to completion, executing the provided
asynchronous closure for each element on the stream. Read more
source§fn try_skip_while<Fut, F>(self, f: F) -> TrySkipWhile<Self, Fut, F>
fn try_skip_while<Fut, F>(self, f: F) -> TrySkipWhile<Self, Fut, F>
Skip elements on this stream while the provided asynchronous predicate
resolves to
true
. Read moresource§fn try_take_while<Fut, F>(self, f: F) -> TryTakeWhile<Self, Fut, F>
fn try_take_while<Fut, F>(self, f: F) -> TryTakeWhile<Self, Fut, F>
Take elements on this stream while the provided asynchronous predicate
resolves to
true
. Read moresource§fn try_for_each_concurrent<Fut, F>(
self,
limit: impl Into<Option<usize>>,
f: F,
) -> TryForEachConcurrent<Self, Fut, F> ⓘ
fn try_for_each_concurrent<Fut, F>( self, limit: impl Into<Option<usize>>, f: F, ) -> TryForEachConcurrent<Self, Fut, F> ⓘ
Attempts to run this stream to completion, executing the provided asynchronous
closure for each element on the stream concurrently as elements become
available, exiting as soon as an error occurs. Read more
source§fn try_collect<C: Default + Extend<Self::Ok>>(self) -> TryCollect<Self, C> ⓘwhere
Self: Sized,
fn try_collect<C: Default + Extend<Self::Ok>>(self) -> TryCollect<Self, C> ⓘwhere
Self: Sized,
Attempt to transform a stream into a collection,
returning a future representing the result of that computation. Read more
source§fn try_chunks(self, capacity: usize) -> TryChunks<Self>where
Self: Sized,
fn try_chunks(self, capacity: usize) -> TryChunks<Self>where
Self: Sized,
An adaptor for chunking up successful items of the stream inside a vector. Read more
source§fn try_ready_chunks(self, capacity: usize) -> TryReadyChunks<Self>where
Self: Sized,
fn try_ready_chunks(self, capacity: usize) -> TryReadyChunks<Self>where
Self: Sized,
An adaptor for chunking up successful, ready items of the stream inside a vector. Read more
source§fn try_filter<Fut, F>(self, f: F) -> TryFilter<Self, Fut, F>
fn try_filter<Fut, F>(self, f: F) -> TryFilter<Self, Fut, F>
Attempt to filter the values produced by this stream according to the
provided asynchronous closure. Read more
source§fn try_filter_map<Fut, F, T>(self, f: F) -> TryFilterMap<Self, Fut, F>
fn try_filter_map<Fut, F, T>(self, f: F) -> TryFilterMap<Self, Fut, F>
Attempt to filter the values produced by this stream while
simultaneously mapping them to a different type according to the
provided asynchronous closure. Read more
source§fn try_flatten_unordered(
self,
limit: impl Into<Option<usize>>,
) -> TryFlattenUnordered<Self>
fn try_flatten_unordered( self, limit: impl Into<Option<usize>>, ) -> TryFlattenUnordered<Self>
Flattens a stream of streams into just one continuous stream. Produced streams
will be polled concurrently and any errors will be passed through without looking at them.
If the underlying base stream returns an error, it will be immediately propagated. Read more
source§fn try_flatten(self) -> TryFlatten<Self>
fn try_flatten(self) -> TryFlatten<Self>
Flattens a stream of streams into just one continuous stream. Read more
source§fn try_fold<T, Fut, F>(self, init: T, f: F) -> TryFold<Self, Fut, T, F> ⓘ
fn try_fold<T, Fut, F>(self, init: T, f: F) -> TryFold<Self, Fut, T, F> ⓘ
Attempt to execute an accumulating asynchronous computation over a
stream, collecting all the values into one final result. Read more
source§fn try_concat(self) -> TryConcat<Self> ⓘwhere
Self: Sized,
Self::Ok: Extend<<<Self as TryStream>::Ok as IntoIterator>::Item> + IntoIterator + Default,
fn try_concat(self) -> TryConcat<Self> ⓘwhere
Self: Sized,
Self::Ok: Extend<<<Self as TryStream>::Ok as IntoIterator>::Item> + IntoIterator + Default,
Attempt to concatenate all items of a stream into a single
extendable destination, returning a future representing the end result. Read more
source§fn try_buffer_unordered(self, n: usize) -> TryBufferUnordered<Self>
fn try_buffer_unordered(self, n: usize) -> TryBufferUnordered<Self>
Attempt to execute several futures from a stream concurrently (unordered). Read more
source§fn try_buffered(self, n: usize) -> TryBuffered<Self>
fn try_buffered(self, n: usize) -> TryBuffered<Self>
Attempt to execute several futures from a stream concurrently. Read more
source§fn try_poll_next_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Option<Result<Self::Ok, Self::Error>>>where
Self: Unpin,
fn try_poll_next_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Option<Result<Self::Ok, Self::Error>>>where
Self: Unpin,
A convenience method for calling
TryStream::try_poll_next
on Unpin
stream types.source§fn into_async_read(self) -> IntoAsyncRead<Self>
fn into_async_read(self) -> IntoAsyncRead<Self>
Adapter that converts this stream into an
AsyncBufRead
. Read moresource§fn try_all<Fut, F>(self, f: F) -> TryAll<Self, Fut, F> ⓘ
fn try_all<Fut, F>(self, f: F) -> TryAll<Self, Fut, F> ⓘ
Attempt to execute a predicate over an asynchronous stream and evaluate if all items
satisfy the predicate. Exits early if an
Err
is encountered or if an Ok
item is found
that does not satisfy the predicate. Read more