pub struct Blocking<T> { /* private fields */ }Expand description
The future spawn_blocking returns: the job’s value once a pool thread has run it.
Dropping it before the job starts cancels the job, which then never runs. Dropping it while
the job runs lets the job finish on its thread and discards the value: a blocking call has no
way to be interrupted. Blocking::detach keeps the job without the value. Awaitable from
any executor, day::task included.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Blocking<T>
impl<T> !Sync for Blocking<T>
impl<T> !UnwindSafe for Blocking<T>
impl<T> Freeze for Blocking<T>where
BlockingInner<T>: Freeze,
impl<T> Send for Blocking<T>where
BlockingInner<T>: Send,
impl<T> Unpin for Blocking<T>where
BlockingInner<T>: Unpin,
impl<T> UnsafeUnpin for Blocking<T>where
BlockingInner<T>: UnsafeUnpin,
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