pub struct MustComplete<T> { /* private fields */ }
Expand description
Make sure that a future or stream will complete, created by
CompletionFutureExt::must_complete
and CompletionStreamExt::must_complete
.
This wraps a CompletionFuture
or CompletionStream
and will ignore all requests to
cancel it, enforcing that it will complete.
Implementations§
Source§impl<T> MustComplete<T>
impl<T> MustComplete<T>
Sourcepub unsafe fn into_inner(self) -> T
pub unsafe fn into_inner(self) -> T
Take the inner item.
§Safety
This value must not be cancelled with CompletionFuture::poll_cancel
or
CompletionStream::poll_cancel
.
Trait Implementations§
Source§impl<T: Clone> Clone for MustComplete<T>
impl<T: Clone> Clone for MustComplete<T>
Source§fn clone(&self) -> MustComplete<T>
fn clone(&self) -> MustComplete<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: CompletionFuture> CompletionFuture for MustComplete<T>
impl<T: CompletionFuture> CompletionFuture for MustComplete<T>
Source§type Output = <T as CompletionFuture>::Output
type Output = <T as CompletionFuture>::Output
The type of value produced on completion.
Source§impl<T: CompletionStream> CompletionStream for MustComplete<T>
impl<T: CompletionStream> CompletionStream for MustComplete<T>
Source§type Item = <T as CompletionStream>::Item
type Item = <T as CompletionStream>::Item
Values yielded by the stream.
Source§unsafe fn poll_next(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Option<Self::Item>>
unsafe fn poll_next( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Option<Self::Item>>
Source§impl<T: Debug> Debug for MustComplete<T>
impl<T: Debug> Debug for MustComplete<T>
impl<'__pin, T> Unpin for MustComplete<T>where
PinnedFieldsOf<__Origin<'__pin, T>>: Unpin,
Auto Trait Implementations§
impl<T> Freeze for MustComplete<T>where
T: Freeze,
impl<T> RefUnwindSafe for MustComplete<T>where
T: RefUnwindSafe,
impl<T> Send for MustComplete<T>where
T: Send,
impl<T> Sync for MustComplete<T>where
T: Sync,
impl<T> UnwindSafe for MustComplete<T>where
T: UnwindSafe,
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§impl<T> CompletionFutureExt for Twhere
T: CompletionFuture + ?Sized,
impl<T> CompletionFutureExt for Twhere
T: CompletionFuture + ?Sized,
Source§fn must_complete(self) -> MustComplete<Self>where
Self: Sized,
fn must_complete(self) -> MustComplete<Self>where
Self: Sized,
Make sure that the future will complete. Any requests to cancel the future through
poll_cancel
will be ignored.Source§fn now_or_never(self) -> NowOrNever<Self> ⓘwhere
Self: Sized,
fn now_or_never(self) -> NowOrNever<Self> ⓘwhere
Self: Sized,
Get the future’s output if it’s ready, or cancel it if it’s not. Read more
Source§fn catch_unwind(self) -> CatchUnwind<Self> ⓘwhere
Self: Sized + UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self> ⓘwhere
Self: Sized + UnwindSafe,
Available on crate feature
std
only.Catch panics in the future. Read more
Source§fn boxed<'a>(self) -> BoxCompletionFuture<'a, Self::Output>
fn boxed<'a>(self) -> BoxCompletionFuture<'a, Self::Output>
Available on crate feature
alloc
only.Box the future, erasing its type. Read more
Source§fn boxed_local<'a>(self) -> LocalBoxCompletionFuture<'a, Self::Output>where
Self: Sized + 'a,
fn boxed_local<'a>(self) -> LocalBoxCompletionFuture<'a, Self::Output>where
Self: Sized + 'a,
Available on crate feature
alloc
only.Box the future locally, erasing its type. Read more
Source§impl<T> CompletionStreamExt for Twhere
T: CompletionStream + ?Sized,
impl<T> CompletionStreamExt for Twhere
T: CompletionStream + ?Sized,
Source§unsafe fn poll_next(&mut self, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>where
Self: Unpin,
unsafe fn poll_next(&mut self, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>where
Self: Unpin,
Source§fn must_complete(self) -> MustComplete<Self>where
Self: Sized,
fn must_complete(self) -> MustComplete<Self>where
Self: Sized,
Make sure that the stream will complete. Any requests to cancel the stream through
poll_cancel
will be ignored.Source§fn next(&mut self) -> Next<'_, Self> ⓘwhere
Self: Unpin,
fn next(&mut self) -> Next<'_, Self> ⓘwhere
Self: Unpin,
Get the next item in the stream. Read more
Source§fn count(self) -> Count<Self> ⓘwhere
Self: Sized,
fn count(self) -> Count<Self> ⓘwhere
Self: Sized,
Count the number of items in the stream. Read more
Source§fn nth(&mut self, n: usize) -> Nth<'_, Self> ⓘwhere
Self: Unpin,
fn nth(&mut self, n: usize) -> Nth<'_, Self> ⓘwhere
Self: Unpin,
Get the nth element in the stream. Read more
Source§fn step_by(self, step: usize) -> StepBy<Self>where
Self: Sized,
fn step_by(self, step: usize) -> StepBy<Self>where
Self: Sized,
Create a stream starting at the same point, but stepping by the given amount each
iteration. Read more
Source§fn chain<U: CompletionStream<Item = Self::Item>>(
self,
other: U,
) -> Chain<Self, U>where
Self: Sized,
fn chain<U: CompletionStream<Item = Self::Item>>(
self,
other: U,
) -> Chain<Self, U>where
Self: Sized,
Chain this stream with another. Read more
Source§fn map<T, F: FnMut(Self::Item) -> T>(self, f: F) -> Map<Self, F>where
Self: Sized,
fn map<T, F: FnMut(Self::Item) -> T>(self, f: F) -> Map<Self, F>where
Self: Sized,
Map this stream’s items with a closure. Read more
Source§fn then<F: FnMut(Self::Item) -> Fut, Fut: CompletionFuture>(
self,
f: F,
) -> Then<Self, F, Fut>where
Self: Sized,
fn then<F: FnMut(Self::Item) -> Fut, Fut: CompletionFuture>(
self,
f: F,
) -> Then<Self, F, Fut>where
Self: Sized,
Map this stream’s items with an asynchronous closure. Read more
Source§fn for_each<F: FnMut(Self::Item)>(self, f: F) -> ForEach<Self, F> ⓘwhere
Self: Sized,
fn for_each<F: FnMut(Self::Item)>(self, f: F) -> ForEach<Self, F> ⓘwhere
Self: Sized,
Call a closure on each item the stream. Read more
Source§fn filter<F>(self, f: F) -> Filter<Self, F>
fn filter<F>(self, f: F) -> Filter<Self, F>
Keep the values in the stream for which the predicate resolves to
true
. Read moreSource§fn filter_map<T, F>(self, f: F) -> FilterMap<Self, F>
fn filter_map<T, F>(self, f: F) -> FilterMap<Self, F>
Filter and map the items of the stream with a closure. Read more
Source§fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
Yield the current iteration count as well as the next value. Read more
Source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
Skip items while the predicate returns
true
. Read moreSource§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
Take items while the predicate returns
true
. Read moreSource§fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
Skip the first
n
items in the stream. Read moreSource§fn take(self, n: usize) -> Take<Self>where
Self: Sized,
fn take(self, n: usize) -> Take<Self>where
Self: Sized,
Takes the first
n
items of the stream. All other items will be ignored. Read moreSource§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
Map the stream, flattening nested structure. Read more
Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
Do something with each element in the stream, passing the value on. Read more
Source§fn collect<C: FromCompletionStream<Self::Item>>(self) -> Collect<Self, C> ⓘwhere
Self: Sized,
fn collect<C: FromCompletionStream<Self::Item>>(self) -> Collect<Self, C> ⓘwhere
Self: Sized,
Collect all the items in the stream into a collection. Read more
Source§fn fold<T, F>(self, init: T, f: F) -> Fold<Self, F, T> ⓘ
fn fold<T, F>(self, init: T, f: F) -> Fold<Self, F, T> ⓘ
Accumulate a value over a stream. Read more
Source§fn all<F: FnMut(Self::Item) -> bool>(&mut self, f: F) -> All<'_, Self, F> ⓘwhere
Self: Unpin,
fn all<F: FnMut(Self::Item) -> bool>(&mut self, f: F) -> All<'_, Self, F> ⓘwhere
Self: Unpin,
Check if all the elements in the stream match a predicate. Read more
Source§fn any<F: FnMut(Self::Item) -> bool>(&mut self, f: F) -> Any<'_, Self, F> ⓘwhere
Self: Unpin,
fn any<F: FnMut(Self::Item) -> bool>(&mut self, f: F) -> Any<'_, Self, F> ⓘwhere
Self: Unpin,
Check if any of the elements in the stream match a predicate. Read more
Source§fn find<P>(&mut self, predicate: P) -> Find<'_, Self, P> ⓘ
fn find<P>(&mut self, predicate: P) -> Find<'_, Self, P> ⓘ
Search for an element in the stream that satisfies a predicate. Read more
Source§fn position<P>(&mut self, predicate: P) -> Position<'_, Self, P> ⓘ
fn position<P>(&mut self, predicate: P) -> Position<'_, Self, P> ⓘ
Get the index of an element in the stream. Read more
Source§fn max_by<F>(self, compare: F) -> MaxBy<Self, F> ⓘ
fn max_by<F>(self, compare: F) -> MaxBy<Self, F> ⓘ
Find the maximum value in the stream using the specified comparison function. Read more
Source§fn max_by_key<B, F>(self, f: F) -> MaxByKey<Self, B, F> ⓘ
fn max_by_key<B, F>(self, f: F) -> MaxByKey<Self, B, F> ⓘ
Find the element that gives the maximum value from the specified function. Read more
Source§fn min_by<F>(self, compare: F) -> MinBy<Self, F> ⓘ
fn min_by<F>(self, compare: F) -> MinBy<Self, F> ⓘ
Find the minimum value in the stream using the specified comparison function. Read more
Source§fn min_by_key<B, F>(self, f: F) -> MinByKey<Self, B, F> ⓘ
fn min_by_key<B, F>(self, f: F) -> MinByKey<Self, B, F> ⓘ
Find the element that gives the minimum value from the specified function. Read more
Source§fn copied<'a, T: Copy + 'a>(self) -> Copied<Self>
fn copied<'a, T: Copy + 'a>(self) -> Copied<Self>
Copy all of the elements in the stream. Read more
Source§fn cloned<'a, T: Clone + 'a>(self) -> Cloned<Self>
fn cloned<'a, T: Clone + 'a>(self) -> Cloned<Self>
Clone all of the elements in the stream. Read more
Source§fn boxed<'a>(self) -> BoxCompletionStream<'a, Self::Item>
fn boxed<'a>(self) -> BoxCompletionStream<'a, Self::Item>
Available on crate feature
alloc
only.Box the stream, erasing its type. Read more
Source§fn boxed_local<'a>(self) -> LocalBoxCompletionStream<'a, Self::Item>where
Self: Sized + 'a,
fn boxed_local<'a>(self) -> LocalBoxCompletionStream<'a, Self::Item>where
Self: Sized + 'a,
Available on crate feature
alloc
only.Box the stream locally, erasing its type. Read more