pub struct Routine { /* private fields */ }
Expand description
§A handle for a routine running in the background
This is an opaque object, coming from ThreadPool::subscribe
, that will drop
the wrapped closure when dropped itself.
Note: it’s your responsibility to hold on to the handle as long as the closure
may be called. Sadly, our capabilities are limited here, so one approach might be
to skip the destructor call with e.g. std::mem::ManuallyDrop
and dropping the wrapper.
This will leak memory but will be guaranteed safe.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Routine
impl RefUnwindSafe for Routine
impl !Send for Routine
impl !Sync for Routine
impl Unpin for Routine
impl UnwindSafe for Routine
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