pub struct DroppableFuture<T> { /* private fields */ }Expand description
A wrapper type for futures that do not need to be polled but still can be awaited.
This exists to silence the default #[must_use] that anonymous async functions return
Futures contained by this type must conform to the semantics of trillium join handles described at [RuntimeTrait::spawn].
Implementations§
Source§impl<T: Future> DroppableFuture<T>
impl<T: Future> DroppableFuture<T>
Sourcepub fn new(future: T) -> Self
pub fn new(future: T) -> Self
Removes the #[must_use] for a future.
This must only be called with a join-handle type future that does not depend on polling to execute.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Returns the inner future.
Trait Implementations§
Source§impl<T: Clone> Clone for DroppableFuture<T>
impl<T: Clone> Clone for DroppableFuture<T>
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: Debug> Debug for DroppableFuture<T>
impl<T: Debug> Debug for DroppableFuture<T>
Source§impl<F: Future> Future for DroppableFuture<F>
impl<F: Future> Future for DroppableFuture<F>
impl<'__pin, T> Unpin for DroppableFuture<T>where
PinnedFieldsOf<__Origin<'__pin, T>>: Unpin,
Auto Trait Implementations§
impl<T> Freeze for DroppableFuture<T>where
T: Freeze,
impl<T> RefUnwindSafe for DroppableFuture<T>where
T: RefUnwindSafe,
impl<T> Send for DroppableFuture<T>where
T: Send,
impl<T> Sync for DroppableFuture<T>where
T: Sync,
impl<T> UnsafeUnpin for DroppableFuture<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for DroppableFuture<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<F> FutureExt for F
impl<F> FutureExt for F
Source§fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
Catches panics while polling the future. 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