pub struct Selector<T, S> { /* private fields */ }Expand description
Selector over a dynamic set of Tasks (generalized Futures/Streams).
Inspired by FuturesUnordered,
designed for flexibility and optimal performance when polling a large number of tasks.
Unless you want to exercise the full flexibility of this type,
you can stick to the specializations exposed in the root of this crate
(e.g. FutureSelector and StreamSelector).
§Removal
The selector creates a heap allocation for each stored task. Removing a task from the selector does not instantly free that memory. The memory can only be freed when:
- all
Idinstances for this task are dropped, AND Removedinstance is dropped, AND- the
Waker(and all its clones) passed when polling the task is dropped, AND - the selector observes the task removal (which happens when the selector is polled).
§Wakeups
The selector uses a smart strategy for polling the tasks. A task is only polled in the following cases:
- after it is pushed into the selector
- after it yields a non-terminal value
- after the waker passed to
Task::poll_progressreceives a wakeup
To avoid nasty surprises, keep this in mind when:
- Modifying a task borrowed from the selector
- Changing the strategy used by the selector (see example)
The wakeups are stored in a FIFO queue. This implies that the selector processes ready tasks in a round-robin fashion.
§Panic
If the Task implementation panics, the task is removed from the selector and dropped,
and the panic propagates. The selector remains valid.
Implementations§
Source§impl<T, S> Selector<T, S>
impl<T, S> Selector<T, S>
Sourcepub fn push(&mut self, task: T) -> BorrowedMut<'_, T>
pub fn push(&mut self, task: T) -> BorrowedMut<'_, T>
Pushes the given task into the selector, returning a mutable reference to the task.
The reference can be used to obtain the task’s Id.
This method is O(1).
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of tasks stored in the selector.
This method is O(1).
Sourcepub fn contains(&self, id: &Id<T>) -> bool
pub fn contains(&self, id: &Id<T>) -> bool
Returns whether the selector contains a task with the given Id.
This method is O(1).
Sourcepub fn get<'a>(&'a self, id: &Id<T>) -> Option<Borrowed<'a, T>>
pub fn get<'a>(&'a self, id: &Id<T>) -> Option<Borrowed<'a, T>>
If the selector contains a task with the given Id, returns a reference to it.
This method is O(1).
Sourcepub fn get_mut<'a>(&'a mut self, id: &Id<T>) -> Option<BorrowedMut<'a, T>>
pub fn get_mut<'a>(&'a mut self, id: &Id<T>) -> Option<BorrowedMut<'a, T>>
If the selector contains a task with the given Id, returns a mutable reference to it.
This method is O(1).
Sourcepub fn remove(&mut self, id: &Id<T>) -> Option<Removed<T>>
pub fn remove(&mut self, id: &Id<T>) -> Option<Removed<T>>
If the selector contains a task with the given Id, removes it.
This method is O(1).
Sourcepub fn strategy_mut(&mut self) -> &mut S
pub fn strategy_mut(&mut self) -> &mut S
Returns a mutable reference to the strategy used by this selector.
Sourcepub fn with_strategy<S1>(self, strategy: S1) -> Selector<T, S1>
pub fn with_strategy<S1>(self, strategy: S1) -> Selector<T, S1>
Returns a new selector with the same state, but different strategy.
Sourcepub fn iter(&self) -> Iter<'_, T> ⓘ
pub fn iter(&self) -> Iter<'_, T> ⓘ
Returns an iterator over all tasks in the selector.
The tasks are visited in the insertion order.
Sourcepub fn iter_mut(&mut self) -> IterMut<'_, T> ⓘ
pub fn iter_mut(&mut self) -> IterMut<'_, T> ⓘ
Returns an iterator that allows for modifying each task in the selector.
The tasks are visited in the insertion order.
Sourcepub fn extract_if<F>(&mut self, pred: F) -> ExtractIf<'_, T, F> ⓘ
pub fn extract_if<F>(&mut self, pred: F) -> ExtractIf<'_, T, F> ⓘ
Creates an iterator which uses a closure to determine if a task should be removed.
If the closure returns true, the task is removed from the selector and yielded. The tasks are visited in the insertion order.
If the returned ExtractIf is not exhausted, e.g. because it is dropped without iterating or the iteration short-circuits,
then the remaining tasks will be retained.
Trait Implementations§
Source§impl<T, S> Extend<T> for Selector<T, S>
impl<T, S> Extend<T> for Selector<T, S>
Source§fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl<T, S> FromIterator<T> for Selector<T, S>where
S: Default,
impl<T, S> FromIterator<T> for Selector<T, S>where
S: Default,
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Source§impl<T, S> IntoIterator for Selector<T, S>
impl<T, S> IntoIterator for Selector<T, S>
Source§impl<'a, T, S> IntoIterator for &'a Selector<T, S>
impl<'a, T, S> IntoIterator for &'a Selector<T, S>
Source§impl<'a, T, S> IntoIterator for &'a mut Selector<T, S>
impl<'a, T, S> IntoIterator for &'a mut Selector<T, S>
impl<T, S> Send for Selector<T, S>
Source§impl<T, S> Stream for Selector<T, S>
impl<T, S> Stream for Selector<T, S>
impl<T, S> Sync for Selector<T, S>
Auto Trait Implementations§
impl<T, S> !RefUnwindSafe for Selector<T, S>
impl<T, S> !UnwindSafe for Selector<T, S>
impl<T, S> Freeze for Selector<T, S>where
S: Freeze,
impl<T, S> Unpin for Selector<T, S>where
S: Unpin,
impl<T, S> UnsafeUnpin for Selector<T, S>where
S: UnsafeUnpin,
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
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,
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>
Source§fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
Source§fn filter<Fut, F>(self, f: F) -> Filter<Self, Fut, F>
fn filter<Fut, F>(self, f: F) -> Filter<Self, Fut, F>
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>
Source§fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
Source§fn collect<C>(self) -> Collect<Self, C> ⓘ
fn collect<C>(self) -> Collect<Self, C> ⓘ
Source§fn unzip<A, B, FromA, FromB>(self) -> Unzip<Self, FromA, FromB> ⓘ
fn unzip<A, B, FromA, FromB>(self) -> Unzip<Self, FromA, FromB> ⓘ
Source§fn concat(self) -> Concat<Self> ⓘ
fn concat(self) -> Concat<Self> ⓘ
Source§fn count(self) -> Count<Self> ⓘwhere
Self: Sized,
fn count(self) -> Count<Self> ⓘwhere
Self: Sized,
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> ⓘ
Source§fn any<Fut, F>(self, f: F) -> Any<Self, Fut, F> ⓘ
fn any<Fut, F>(self, f: F) -> Any<Self, Fut, F> ⓘ
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> ⓘ
true if all element in stream satisfied a predicate. Read moreSource§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Source§fn flatten_unordered(
self,
limit: impl Into<Option<usize>>,
) -> FlattenUnorderedWithFlowController<Self, ()>
fn flatten_unordered( self, limit: impl Into<Option<usize>>, ) -> FlattenUnorderedWithFlowController<Self, ()>
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>
StreamExt::map but flattens nested Streams
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>
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>
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>
true. Read moreSource§fn take_until<Fut>(self, fut: Fut) -> TakeUntil<Self, Fut>
fn take_until<Fut>(self, fut: Fut) -> TakeUntil<Self, Fut>
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> ⓘ
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> ⓘ
Source§fn take(self, n: usize) -> Take<Self>where
Self: Sized,
fn take(self, n: usize) -> Take<Self>where
Self: Sized,
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,
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,
Source§fn boxed<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + Send + 'a>>
fn boxed<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + Send + 'a>>
Source§fn boxed_local<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a>>where
Self: Sized + 'a,
fn boxed_local<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a>>where
Self: Sized + 'a,
Source§fn buffered(self, n: usize) -> Buffered<Self>
fn buffered(self, n: usize) -> Buffered<Self>
Source§fn buffer_unordered(self, n: usize) -> BufferUnordered<Self>
fn buffer_unordered(self, n: usize) -> BufferUnordered<Self>
Source§fn zip<St>(self, other: St) -> Zip<Self, St>
fn zip<St>(self, other: St) -> Zip<Self, St>
Source§fn peekable(self) -> Peekable<Self>where
Self: Sized,
fn peekable(self) -> Peekable<Self>where
Self: Sized,
peek method. Read moreSource§fn chunks(self, capacity: usize) -> Chunks<Self>where
Self: Sized,
fn chunks(self, capacity: usize) -> Chunks<Self>where
Self: Sized,
Source§fn ready_chunks(self, capacity: usize) -> ReadyChunks<Self>where
Self: Sized,
fn ready_chunks(self, capacity: usize) -> ReadyChunks<Self>where
Self: Sized,
Source§fn forward<S>(self, sink: S) -> Forward<Self, S> ⓘ
fn forward<S>(self, sink: S) -> Forward<Self, S> ⓘ
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>
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,
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<S, T> Task<&mut S> for T
impl<S, T> Task<&mut S> for T
Source§type Cont = <T as Task<S>>::Cont
type Cont = <T as Task<S>>::Cont
Self::poll_progress
when the task produces some value, but has not finished yet.Source§type Break = <T as Task<S>>::Break
type Break = <T as Task<S>>::Break
Self::poll_progress
when the task produces its last value.Source§type Output = <T as Task<S>>::Output
type Output = <T as Task<S>>::Output
Self::Cont/Self::Break
in Self::transform_cont/Self::transform_break.Source§fn poll_progress(
self: Pin<&mut T>,
strategy: &mut &mut S,
cx: &mut Context<'_>,
) -> Poll<ControlFlow<<T as Task<&mut S>>::Break, <T as Task<&mut S>>::Cont>>
fn poll_progress( self: Pin<&mut T>, strategy: &mut &mut S, cx: &mut Context<'_>, ) -> Poll<ControlFlow<<T as Task<&mut S>>::Break, <T as Task<&mut S>>::Cont>>
Source§fn transform_cont(
task: BorrowedMut<'_, T>,
strategy: &mut &mut S,
value: <T as Task<&mut S>>::Cont,
) -> Option<<T as Task<&mut S>>::Output>
fn transform_cont( task: BorrowedMut<'_, T>, strategy: &mut &mut S, value: <T as Task<&mut S>>::Cont, ) -> Option<<T as Task<&mut S>>::Output>
Self::Cont value obtained from Self::poll_progress
into the final value type Self::Output. Read moreSource§fn transform_break(
task: Removed<T>,
strategy: &mut &mut S,
value: <T as Task<&mut S>>::Break,
) -> Option<<T as Task<&mut S>>::Output>
fn transform_break( task: Removed<T>, strategy: &mut &mut S, value: <T as Task<&mut S>>::Break, ) -> Option<<T as Task<&mut S>>::Output>
Self::Break value obtained from Self::poll_progress
into the final value type Self::Output. Read moreSource§impl<S, T> Task<Box<S>> for T
impl<S, T> Task<Box<S>> for T
Source§type Cont = <T as Task<S>>::Cont
type Cont = <T as Task<S>>::Cont
Self::poll_progress
when the task produces some value, but has not finished yet.Source§type Break = <T as Task<S>>::Break
type Break = <T as Task<S>>::Break
Self::poll_progress
when the task produces its last value.Source§type Output = <T as Task<S>>::Output
type Output = <T as Task<S>>::Output
Self::Cont/Self::Break
in Self::transform_cont/Self::transform_break.Source§fn poll_progress(
self: Pin<&mut T>,
strategy: &mut Box<S>,
cx: &mut Context<'_>,
) -> Poll<ControlFlow<<T as Task<Box<S>>>::Break, <T as Task<Box<S>>>::Cont>>
fn poll_progress( self: Pin<&mut T>, strategy: &mut Box<S>, cx: &mut Context<'_>, ) -> Poll<ControlFlow<<T as Task<Box<S>>>::Break, <T as Task<Box<S>>>::Cont>>
Source§fn transform_cont(
task: BorrowedMut<'_, T>,
strategy: &mut Box<S>,
value: <T as Task<Box<S>>>::Cont,
) -> Option<<T as Task<Box<S>>>::Output>
fn transform_cont( task: BorrowedMut<'_, T>, strategy: &mut Box<S>, value: <T as Task<Box<S>>>::Cont, ) -> Option<<T as Task<Box<S>>>::Output>
Self::Cont value obtained from Self::poll_progress
into the final value type Self::Output. Read moreSource§fn transform_break(
task: Removed<T>,
strategy: &mut Box<S>,
value: <T as Task<Box<S>>>::Break,
) -> Option<<T as Task<Box<S>>>::Output>
fn transform_break( task: Removed<T>, strategy: &mut Box<S>, value: <T as Task<Box<S>>>::Break, ) -> Option<<T as Task<Box<S>>>::Output>
Self::Break value obtained from Self::poll_progress
into the final value type Self::Output. Read moreSource§impl<S> Task<StreamBasic> for Swhere
S: Stream,
impl<S> Task<StreamBasic> for Swhere
S: Stream,
Source§type Cont = <S as Stream>::Item
type Cont = <S as Stream>::Item
Self::poll_progress
when the task produces some value, but has not finished yet.Source§type Break = ()
type Break = ()
Self::poll_progress
when the task produces its last value.Source§type Output = <S as Stream>::Item
type Output = <S as Stream>::Item
Self::Cont/Self::Break
in Self::transform_cont/Self::transform_break.Source§fn poll_progress(
self: Pin<&mut S>,
_: &mut StreamBasic,
cx: &mut Context<'_>,
) -> Poll<ControlFlow<<S as Task<StreamBasic>>::Break, <S as Task<StreamBasic>>::Cont>>
fn poll_progress( self: Pin<&mut S>, _: &mut StreamBasic, cx: &mut Context<'_>, ) -> Poll<ControlFlow<<S as Task<StreamBasic>>::Break, <S as Task<StreamBasic>>::Cont>>
Source§fn transform_cont(
_: BorrowedMut<'_, S>,
_: &mut StreamBasic,
value: <S as Task<StreamBasic>>::Cont,
) -> Option<<S as Task<StreamBasic>>::Output>
fn transform_cont( _: BorrowedMut<'_, S>, _: &mut StreamBasic, value: <S as Task<StreamBasic>>::Cont, ) -> Option<<S as Task<StreamBasic>>::Output>
Self::Cont value obtained from Self::poll_progress
into the final value type Self::Output. Read moreSource§fn transform_break(
_: Removed<S>,
_: &mut StreamBasic,
_: <S as Task<StreamBasic>>::Break,
) -> Option<<S as Task<StreamBasic>>::Output>
fn transform_break( _: Removed<S>, _: &mut StreamBasic, _: <S as Task<StreamBasic>>::Break, ) -> Option<<S as Task<StreamBasic>>::Output>
Self::Break value obtained from Self::poll_progress
into the final value type Self::Output. Read moreSource§impl<S> Task<StreamReclaim> for Swhere
S: Stream,
impl<S> Task<StreamReclaim> for Swhere
S: Stream,
Source§type Cont = <S as Stream>::Item
type Cont = <S as Stream>::Item
Self::poll_progress
when the task produces some value, but has not finished yet.Source§type Break = ()
type Break = ()
Self::poll_progress
when the task produces its last value.Source§type Output = ControlFlow<Removed<S>, (Id<S>, <S as Stream>::Item)>
type Output = ControlFlow<Removed<S>, (Id<S>, <S as Stream>::Item)>
Self::Cont/Self::Break
in Self::transform_cont/Self::transform_break.Source§fn poll_progress(
self: Pin<&mut S>,
_: &mut StreamReclaim,
cx: &mut Context<'_>,
) -> Poll<ControlFlow<<S as Task<StreamReclaim>>::Break, <S as Task<StreamReclaim>>::Cont>>
fn poll_progress( self: Pin<&mut S>, _: &mut StreamReclaim, cx: &mut Context<'_>, ) -> Poll<ControlFlow<<S as Task<StreamReclaim>>::Break, <S as Task<StreamReclaim>>::Cont>>
Source§fn transform_cont(
task: BorrowedMut<'_, S>,
_: &mut StreamReclaim,
value: <S as Task<StreamReclaim>>::Cont,
) -> Option<<S as Task<StreamReclaim>>::Output>
fn transform_cont( task: BorrowedMut<'_, S>, _: &mut StreamReclaim, value: <S as Task<StreamReclaim>>::Cont, ) -> Option<<S as Task<StreamReclaim>>::Output>
Self::Cont value obtained from Self::poll_progress
into the final value type Self::Output. Read moreSource§fn transform_break(
task: Removed<S>,
_: &mut StreamReclaim,
_: <S as Task<StreamReclaim>>::Break,
) -> Option<<S as Task<StreamReclaim>>::Output>
fn transform_break( task: Removed<S>, _: &mut StreamReclaim, _: <S as Task<StreamReclaim>>::Break, ) -> Option<<S as Task<StreamReclaim>>::Output>
Self::Break value obtained from Self::poll_progress
into the final value type Self::Output. Read moreSource§impl<S> Task<StreamWithId> for Swhere
S: Stream,
impl<S> Task<StreamWithId> for Swhere
S: Stream,
Source§type Cont = <S as Stream>::Item
type Cont = <S as Stream>::Item
Self::poll_progress
when the task produces some value, but has not finished yet.Source§type Break = ()
type Break = ()
Self::poll_progress
when the task produces its last value.Source§type Output = (Id<S>, <S as Stream>::Item)
type Output = (Id<S>, <S as Stream>::Item)
Self::Cont/Self::Break
in Self::transform_cont/Self::transform_break.Source§fn poll_progress(
self: Pin<&mut S>,
_: &mut StreamWithId,
cx: &mut Context<'_>,
) -> Poll<ControlFlow<<S as Task<StreamWithId>>::Break, <S as Task<StreamWithId>>::Cont>>
fn poll_progress( self: Pin<&mut S>, _: &mut StreamWithId, cx: &mut Context<'_>, ) -> Poll<ControlFlow<<S as Task<StreamWithId>>::Break, <S as Task<StreamWithId>>::Cont>>
Source§fn transform_cont(
task: BorrowedMut<'_, S>,
_: &mut StreamWithId,
value: <S as Task<StreamWithId>>::Cont,
) -> Option<<S as Task<StreamWithId>>::Output>
fn transform_cont( task: BorrowedMut<'_, S>, _: &mut StreamWithId, value: <S as Task<StreamWithId>>::Cont, ) -> Option<<S as Task<StreamWithId>>::Output>
Self::Cont value obtained from Self::poll_progress
into the final value type Self::Output. Read moreSource§fn transform_break(
_: Removed<S>,
_: &mut StreamWithId,
_: <S as Task<StreamWithId>>::Break,
) -> Option<<S as Task<StreamWithId>>::Output>
fn transform_break( _: Removed<S>, _: &mut StreamWithId, _: <S as Task<StreamWithId>>::Break, ) -> Option<<S as Task<StreamWithId>>::Output>
Self::Break value obtained from Self::poll_progress
into the final value type Self::Output. Read moreSource§impl<S> Task<TryStreamBasic> for Swhere
S: TryStream,
impl<S> Task<TryStreamBasic> for Swhere
S: TryStream,
Source§type Cont = <S as TryStream>::Ok
type Cont = <S as TryStream>::Ok
Self::poll_progress
when the task produces some value, but has not finished yet.Source§type Break = Result<(), <S as TryStream>::Error>
type Break = Result<(), <S as TryStream>::Error>
Self::poll_progress
when the task produces its last value.Source§type Output = Result<<S as TryStream>::Ok, <S as TryStream>::Error>
type Output = Result<<S as TryStream>::Ok, <S as TryStream>::Error>
Self::Cont/Self::Break
in Self::transform_cont/Self::transform_break.Source§fn poll_progress(
self: Pin<&mut S>,
_: &mut TryStreamBasic,
cx: &mut Context<'_>,
) -> Poll<ControlFlow<<S as Task<TryStreamBasic>>::Break, <S as Task<TryStreamBasic>>::Cont>>
fn poll_progress( self: Pin<&mut S>, _: &mut TryStreamBasic, cx: &mut Context<'_>, ) -> Poll<ControlFlow<<S as Task<TryStreamBasic>>::Break, <S as Task<TryStreamBasic>>::Cont>>
Source§fn transform_cont(
_: BorrowedMut<'_, S>,
_: &mut TryStreamBasic,
value: <S as Task<TryStreamBasic>>::Cont,
) -> Option<<S as Task<TryStreamBasic>>::Output>
fn transform_cont( _: BorrowedMut<'_, S>, _: &mut TryStreamBasic, value: <S as Task<TryStreamBasic>>::Cont, ) -> Option<<S as Task<TryStreamBasic>>::Output>
Self::Cont value obtained from Self::poll_progress
into the final value type Self::Output. Read moreSource§fn transform_break(
_: Removed<S>,
_: &mut TryStreamBasic,
value: <S as Task<TryStreamBasic>>::Break,
) -> Option<<S as Task<TryStreamBasic>>::Output>
fn transform_break( _: Removed<S>, _: &mut TryStreamBasic, value: <S as Task<TryStreamBasic>>::Break, ) -> Option<<S as Task<TryStreamBasic>>::Output>
Self::Break value obtained from Self::poll_progress
into the final value type Self::Output. Read moreSource§impl<S> Task<TryStreamReclaim> for Swhere
S: TryStream,
impl<S> Task<TryStreamReclaim> for Swhere
S: TryStream,
Source§type Cont = <S as TryStream>::Ok
type Cont = <S as TryStream>::Ok
Self::poll_progress
when the task produces some value, but has not finished yet.Source§type Break = Result<(), <S as TryStream>::Error>
type Break = Result<(), <S as TryStream>::Error>
Self::poll_progress
when the task produces its last value.Source§type Output = ControlFlow<(Removed<S>, Result<(), <S as TryStream>::Error>), (Id<S>, <S as TryStream>::Ok)>
type Output = ControlFlow<(Removed<S>, Result<(), <S as TryStream>::Error>), (Id<S>, <S as TryStream>::Ok)>
Self::Cont/Self::Break
in Self::transform_cont/Self::transform_break.Source§fn poll_progress(
self: Pin<&mut S>,
_: &mut TryStreamReclaim,
cx: &mut Context<'_>,
) -> Poll<ControlFlow<<S as Task<TryStreamReclaim>>::Break, <S as Task<TryStreamReclaim>>::Cont>>
fn poll_progress( self: Pin<&mut S>, _: &mut TryStreamReclaim, cx: &mut Context<'_>, ) -> Poll<ControlFlow<<S as Task<TryStreamReclaim>>::Break, <S as Task<TryStreamReclaim>>::Cont>>
Source§fn transform_cont(
task: BorrowedMut<'_, S>,
_: &mut TryStreamReclaim,
value: <S as Task<TryStreamReclaim>>::Cont,
) -> Option<<S as Task<TryStreamReclaim>>::Output>
fn transform_cont( task: BorrowedMut<'_, S>, _: &mut TryStreamReclaim, value: <S as Task<TryStreamReclaim>>::Cont, ) -> Option<<S as Task<TryStreamReclaim>>::Output>
Self::Cont value obtained from Self::poll_progress
into the final value type Self::Output. Read moreSource§fn transform_break(
task: Removed<S>,
_: &mut TryStreamReclaim,
value: <S as Task<TryStreamReclaim>>::Break,
) -> Option<<S as Task<TryStreamReclaim>>::Output>
fn transform_break( task: Removed<S>, _: &mut TryStreamReclaim, value: <S as Task<TryStreamReclaim>>::Break, ) -> Option<<S as Task<TryStreamReclaim>>::Output>
Self::Break value obtained from Self::poll_progress
into the final value type Self::Output. Read moreSource§impl<S> Task<TryStreamWithId> for Swhere
S: TryStream,
impl<S> Task<TryStreamWithId> for Swhere
S: TryStream,
Source§type Cont = <S as TryStream>::Ok
type Cont = <S as TryStream>::Ok
Self::poll_progress
when the task produces some value, but has not finished yet.Source§type Break = Result<(), <S as TryStream>::Error>
type Break = Result<(), <S as TryStream>::Error>
Self::poll_progress
when the task produces its last value.Source§type Output = (Id<S>, Result<<S as TryStream>::Ok, <S as TryStream>::Error>)
type Output = (Id<S>, Result<<S as TryStream>::Ok, <S as TryStream>::Error>)
Self::Cont/Self::Break
in Self::transform_cont/Self::transform_break.Source§fn poll_progress(
self: Pin<&mut S>,
_: &mut TryStreamWithId,
cx: &mut Context<'_>,
) -> Poll<ControlFlow<<S as Task<TryStreamWithId>>::Break, <S as Task<TryStreamWithId>>::Cont>>
fn poll_progress( self: Pin<&mut S>, _: &mut TryStreamWithId, cx: &mut Context<'_>, ) -> Poll<ControlFlow<<S as Task<TryStreamWithId>>::Break, <S as Task<TryStreamWithId>>::Cont>>
Source§fn transform_cont(
task: BorrowedMut<'_, S>,
_: &mut TryStreamWithId,
value: <S as Task<TryStreamWithId>>::Cont,
) -> Option<<S as Task<TryStreamWithId>>::Output>
fn transform_cont( task: BorrowedMut<'_, S>, _: &mut TryStreamWithId, value: <S as Task<TryStreamWithId>>::Cont, ) -> Option<<S as Task<TryStreamWithId>>::Output>
Self::Cont value obtained from Self::poll_progress
into the final value type Self::Output. Read moreSource§fn transform_break(
task: Removed<S>,
_: &mut TryStreamWithId,
value: <S as Task<TryStreamWithId>>::Break,
) -> Option<<S as Task<TryStreamWithId>>::Output>
fn transform_break( task: Removed<S>, _: &mut TryStreamWithId, value: <S as Task<TryStreamWithId>>::Break, ) -> Option<<S as Task<TryStreamWithId>>::Output>
Self::Break value obtained from Self::poll_progress
into the final value type Self::Output. Read moreSource§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>
Source§fn map_ok<T, F>(self, f: F) -> MapOk<Self, F>
fn map_ok<T, F>(self, f: F) -> MapOk<Self, F>
Source§fn map_err<E, F>(self, f: F) -> MapErr<Self, F>
fn map_err<E, F>(self, f: F) -> MapErr<Self, F>
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>
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>
f. Read moreSource§fn inspect_ok<F>(self, f: F) -> InspectOk<Self, F>
fn inspect_ok<F>(self, f: F) -> InspectOk<Self, F>
Source§fn inspect_err<F>(self, f: F) -> InspectErr<Self, F>
fn inspect_err<F>(self, f: F) -> InspectErr<Self, F>
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,
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> ⓘ
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>
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>
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> ⓘ
Source§fn try_collect<C>(self) -> TryCollect<Self, C> ⓘ
fn try_collect<C>(self) -> TryCollect<Self, C> ⓘ
Source§fn try_chunks(self, capacity: usize) -> TryChunks<Self>where
Self: Sized,
fn try_chunks(self, capacity: usize) -> TryChunks<Self>where
Self: Sized,
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,
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>
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>
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>
Source§fn try_flatten(self) -> TryFlatten<Self>
fn try_flatten(self) -> TryFlatten<Self>
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> ⓘ
Source§fn try_concat(self) -> TryConcat<Self> ⓘ
fn try_concat(self) -> TryConcat<Self> ⓘ
Source§fn try_buffer_unordered(self, n: usize) -> TryBufferUnordered<Self>
fn try_buffer_unordered(self, n: usize) -> TryBufferUnordered<Self>
Source§fn try_buffered(self, n: usize) -> TryBuffered<Self>
fn try_buffered(self, n: usize) -> TryBuffered<Self>
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,
TryStream::try_poll_next on Unpin
stream types.Source§fn into_async_read(self) -> IntoAsyncRead<Self>
fn into_async_read(self) -> IntoAsyncRead<Self>
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> ⓘ
Err is encountered or if an Ok item is found
that does not satisfy the predicate. Read more