pub struct PreparedWork<T> { /* private fields */ }Expand description
A registered work envelope without an eagerly spawned thread. Retain a cancellation handle until it runs or is explicitly cancelled.
Implementations§
Source§impl<T: Send + 'static> PreparedWork<T>
impl<T: Send + 'static> PreparedWork<T>
Sourcepub fn cancel_handle(&self) -> CancelHandle
pub fn cancel_handle(&self) -> CancelHandle
Additional guards share one terminal reservation; dropping any live guard cancels the work. A scheduler can retain its own guard while the UI owns one.
pub fn run(self, work: impl FnOnce(CancelToken) -> Outcome<T>)
Auto Trait Implementations§
impl<T> !RefUnwindSafe for PreparedWork<T>
impl<T> !UnwindSafe for PreparedWork<T>
impl<T> Freeze for PreparedWork<T>
impl<T> Send for PreparedWork<T>
impl<T> Sync for PreparedWork<T>
impl<T> Unpin for PreparedWork<T>
impl<T> UnsafeUnpin for PreparedWork<T>
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