pub struct Blocking<T> { /* private fields */ }Expand description
The blocking pool (docs/async.md): spawn_blocking runs a job on a worker thread and
resolves on the awaiting side; std-only, so it lives in day-async and is re-exported here.
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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