Struct leak_playground_tokio::task::ScopedJoinHandle
source · pub struct ScopedJoinHandle<'a, T> {
inner: ManuallyDrop<JoinHandle<Payload>>,
_unforget: Unforget<'static, PhantomData<&'a ()>>,
_output: PhantomData<T>,
_unsend: PhantomData<*mut ()>,
}
Expand description
Handle to a task, which cancels on drop.
This is made to ensure we won’t put task into itself, thus forgetting it.
To spawn use spawn_scoped
, spawn_local_scoped
, or
spawn_blocking_scoped
.
Fields§
§inner: ManuallyDrop<JoinHandle<Payload>>
§_unforget: Unforget<'static, PhantomData<&'a ()>>
§_output: PhantomData<T>
§_unsend: PhantomData<*mut ()>
Implementations§
source§impl<'a, T> ScopedJoinHandle<'a, T>
impl<'a, T> ScopedJoinHandle<'a, T>
pub async fn cancel(self) -> Result<(), JoinError>
pub fn abort(&self)
pub fn abort_handle(&self) -> AbortHandle
Trait Implementations§
source§impl<'a, T> Drop for ScopedJoinHandle<'a, T>
impl<'a, T> Drop for ScopedJoinHandle<'a, T>
source§impl<'a, T> Future for ScopedJoinHandle<'a, T>
impl<'a, T> Future for ScopedJoinHandle<'a, T>
impl<T: Send> Send for ScopedJoinHandle<'static, T>
impl<T: Send> Sync for ScopedJoinHandle<'_, T>
impl<T> Unpin for ScopedJoinHandle<'_, T>
Auto Trait Implementations§
impl<'a, T> Forget for ScopedJoinHandle<'a, T>where
'a: 'static,
T: Forget,
impl<'a, T> Freeze for ScopedJoinHandle<'a, T>
impl<'a, T> RefUnwindSafe for ScopedJoinHandle<'a, T>where
T: RefUnwindSafe,
impl<'a, T> UnwindSafe for ScopedJoinHandle<'a, 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<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
§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