Struct ScopedJoinHandle
pub struct ScopedJoinHandle<'scope, T> { /* private fields */ }
A handle that can be used to join its scoped thread.
This struct is created by the Scope::spawn method and the
ScopedThreadBuilder::spawn method.
Implementations
impl<T> ScopedJoinHandle<'_, T>
fn join(self) -> Result<T>Waits for the thread to finish and returns its result.
If the child thread panics, an error is returned. Note that if panics are implemented by aborting the process, no error is returned; see the notes of [std::panic::catch_unwind].
Panics
This function may panic on some platforms if a thread attempts to join itself or otherwise may create a deadlock with joining threads.
Examples
use thread; scope.unwrap;fn thread(&self) -> &ThreadReturns a handle to the underlying thread.
Examples
use thread; scope.unwrap;
Trait Implementations
impl<T> Debug for ScopedJoinHandle<'_, T>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<T> JoinHandleExt for ScopedJoinHandle<'_, T>
fn as_pthread_t(&self) -> RawPthreadfn into_pthread_t(self) -> RawPthread
impl<T> Send for ScopedJoinHandle<'_, T>
impl<T> Sync for ScopedJoinHandle<'_, T>
Auto Trait Implementations
impl<'scope, T> Freeze for ScopedJoinHandle<'scope, T>
where
Arc<Mutex<Option<T>>>: Freeze,
impl<'scope, T> RefUnwindSafe for ScopedJoinHandle<'scope, T>
where
Arc<Mutex<Option<T>>>: RefUnwindSafe,
impl<'scope, T> Unpin for ScopedJoinHandle<'scope, T>
where
Arc<Mutex<Option<T>>>: Unpin,
impl<'scope, T> UnsafeUnpin for ScopedJoinHandle<'scope, T>
where
Arc<Mutex<Option<T>>>: UnsafeUnpin,
impl<'scope, T> UnwindSafe for ScopedJoinHandle<'scope, T>
where
Arc<Mutex<Option<T>>>: UnwindSafe,
Blanket Implementations
impl<T> Any for ScopedJoinHandle<'scope, T>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for ScopedJoinHandle<'scope, T>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for ScopedJoinHandle<'scope, T>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for ScopedJoinHandle<'scope, T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into<U> for ScopedJoinHandle<'scope, T>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for ScopedJoinHandle<'scope, T>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for ScopedJoinHandle<'scope, T>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>