pub struct AbsurdFuture<F, T> { /* private fields */ }Expand description
Turn a never-returning future into a future yielding any desired type.
This struct is created by the absurd_future function.
Useful for async tasks that logically don’t complete but need to satisfy an
interface expecting a concrete output type. Because the inner future never
resolves, this future will also never resolve, so the output type T is
never actually produced.
Implementations§
Source§impl<F, T> AbsurdFuture<F, T>
impl<F, T> AbsurdFuture<F, T>
Trait Implementations§
Source§impl<F, T> Future for AbsurdFuture<F, T>where
F: Future<Output = Infallible>,
impl<F, T> Future for AbsurdFuture<F, T>where
F: Future<Output = Infallible>,
Auto Trait Implementations§
impl<F, T> Freeze for AbsurdFuture<F, T>
impl<F, T> RefUnwindSafe for AbsurdFuture<F, T>where
F: RefUnwindSafe,
impl<F, T> Send for AbsurdFuture<F, T>where
F: Send,
impl<F, T> Sync for AbsurdFuture<F, T>where
F: Sync,
impl<F, T> Unpin for AbsurdFuture<F, T>
impl<F, T> UnwindSafe for AbsurdFuture<F, T>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