pub struct CatchUnwind<F> { /* private fields */ }Expand description
A future adapter that catches a panic from the inner future’s poll and
resolves to Err(payload) instead of unwinding into the executor.
This is how run_async keeps the “callback fires exactly once” promise
even when the producer’s future panics: it awaits
CatchUnwind::new(user_future) and reports an Err through the
completion callback with the reserved panic code.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for CatchUnwind<F>
impl<F> RefUnwindSafe for CatchUnwind<F>where
F: RefUnwindSafe,
impl<F> Send for CatchUnwind<F>where
F: Send,
impl<F> Sync for CatchUnwind<F>where
F: Sync,
impl<F> Unpin for CatchUnwind<F>
impl<F> UnsafeUnpin for CatchUnwind<F>
impl<F> UnwindSafe for CatchUnwind<F>where
F: 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<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§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