[−][src]Trait completion::future::CompletionFutureExt
Extension trait for CompletionFuture
.
Provided methods
pub unsafe fn poll(&mut self, cx: &mut Context<'_>) -> Poll<Self::Output> where
Self: Unpin,
[src]
Self: Unpin,
A convenience for calling CompletionFuture::poll
on Unpin
futures.
Safety
Identical to CompletionFuture::poll
.
pub fn catch_unwind(self) -> CatchUnwind<Self>ⓘNotable traits for CatchUnwind<F>
impl<F: Future + UnwindSafe + ?Sized> Future for CatchUnwind<F> type Output = Result<F::Output, Box<dyn Any + Send>>;
where
Self: Sized + UnwindSafe,
[src]
Notable traits for CatchUnwind<F>
impl<F: Future + UnwindSafe + ?Sized> Future for CatchUnwind<F> type Output = Result<F::Output, Box<dyn Any + Send>>;
Self: Sized + UnwindSafe,
Catch panics in the future.
Requires the std
feature.
Examples
use completion::{CompletionFutureExt, completion_async}; let future = completion_async!(panic!()); assert!(future.catch_unwind().await.is_err());
pub fn boxed<'a>(self) -> BoxCompletionFuture<'a, Self::Output> where
Self: Sized + Send + 'a,
[src]
Self: Sized + Send + 'a,
Box the future, erasing its type.
Requires the alloc
feature.
Examples
use completion::{CompletionFutureExt, completion_async}; // These futures are different types, but boxing them makes them the same type. let fut = if some_condition { completion_async!(5).boxed() } else { completion_async!(6).boxed() };
pub fn boxed_local<'a>(self) -> LocalBoxCompletionFuture<'a, Self::Output> where
Self: Sized + 'a,
[src]
Self: Sized + 'a,
Box the future locally, erasing its type.
Requires the alloc
feature.
Examples
use completion::{CompletionFutureExt, completion_async}; // These futures are different types, but boxing them makes them the same type. let fut = if some_condition { completion_async!(5).boxed_local() } else { completion_async!(6).boxed_local() };