Struct leak_playground_std::thread::JoinGuard
source · pub struct JoinGuard<'a, T> {
child: ManuallyDrop<JoinHandle<T>>,
_borrow: Unforget<'static, PhantomData<&'a ()>>,
_unsend: PhantomData<*mut ()>,
}
Expand description
Handle to a thread, which joins on drop.
Cannot be sent across threads. This is made to ensure we won’t put this into itself, thus forgetting it.
To spawn use spawn_scoped
.
Fields§
§child: ManuallyDrop<JoinHandle<T>>
§_borrow: Unforget<'static, PhantomData<&'a ()>>
Not sure about covariance there.
_unsend: PhantomData<*mut ()>
Implementations§
source§impl<T> JoinGuard<'static, T>
impl<T> JoinGuard<'static, T>
pub fn into_handle(self) -> JoinHandle<T>
pub fn detach(self)
Trait Implementations§
source§impl<T> From<JoinGuard<'static, T>> for JoinHandle<T>
impl<T> From<JoinGuard<'static, T>> for JoinHandle<T>
impl<T> Send for JoinGuard<'_, T>where
Self: Forget,
impl<T> Sync for JoinGuard<'_, T>
Auto Trait Implementations§
impl<'a, T> Forget for JoinGuard<'a, T>where
'a: 'static,
impl<'a, T> Freeze for JoinGuard<'a, T>
impl<'a, T> !RefUnwindSafe for JoinGuard<'a, T>
impl<'a, T> Unpin for JoinGuard<'a, T>
impl<'a, T> !UnwindSafe for JoinGuard<'a, 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