# [−][src]Struct crossbeam::thread::ScopedJoinHandle

    pub struct ScopedJoinHandle<'scope, T> { /* fields omitted */ }

A handle that can be used to join its scoped thread.

## Methods

### `impl<'scope, T> ScopedJoinHandle<'scope, T>`[src]

#### `pub fn join(self) -> Result<T, Box<dyn Any + 'static + Send>>`[src]

Waits for the thread to finish and returns its result.

If the child thread panics, an error is returned.

# 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 crossbeam_utils::thread;

    thread::scope(|s| {
        let handle1 = s.spawn(|_| println!("I'm a happy thread :)"));
        let handle2 = s.spawn(|_| panic!("I'm a sad thread :("));

        // Join the first thread and verify that it succeeded.
        let res = handle1.join();
        assert!(res.is_ok());

        // Join the second thread and verify that it panicked.
        let res = handle2.join();
        assert!(res.is_err());
    }).unwrap();

#### `pub fn thread(&self) -> &Thread`[src]

Returns a handle to the underlying thread.

# Examples

    use crossbeam_utils::thread;

    thread::scope(|s| {
        let handle = s.spawn(|_| println!("A child thread is running"));
        println!("The child thread ID: {:?}", handle.thread().id());
    }).unwrap();

## Trait Implementations

### `impl<'scope, T> Debug for ScopedJoinHandle<'scope, T>`[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result<(), Error>`[src]

Formats the value using the given formatter. Read more

### `impl<'scope, T> Sync for ScopedJoinHandle<'scope, T>`[src]

### `impl<'scope, T> Send for ScopedJoinHandle<'scope, T>`[src]

## Auto Trait Implementations

### `impl<'scope, T> Unpin for ScopedJoinHandle<'scope, T>`

### `impl<'scope, T> !UnwindSafe for ScopedJoinHandle<'scope, T>`

### `impl<'scope, T> !RefUnwindSafe for ScopedJoinHandle<'scope, T>`

## Blanket Implementations

### `impl<T, U> Into<U> for T where
U: From<T>,` [src]

#### `fn into(self) -> U`[src]

Performs the conversion.

### `impl<T> From<T> for T`[src]

#### `fn from(t: T) -> T`[src]

Performs the conversion.

### `impl<T, U> TryFrom<U> for T where
U: Into<T>,` [src]

#### `type Error = Infallible`

The type returned in the event of a conversion error.

#### `fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>`[src]

Performs the conversion.

### `impl<T, U> TryInto<U> for T where
U: TryFrom<T>,` [src]

#### `type Error = <U as TryFrom<T>>::Error`

The type returned in the event of a conversion error.

#### `fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>`[src]

Performs the conversion.

### `impl<T> BorrowMut<T> for T where
T: ?Sized,` [src]

####
ⓘImportant traits for &'_ mut W

### Important traits for &'_ mut W

`impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;`
`fn borrow_mut(&mut self) -> &mut T`[src]

Mutably borrows from an owned value. Read more

### `impl<T> Borrow<T> for T where
T: ?Sized,` [src]

####
ⓘImportant traits for &'_ mut W

### Important traits for &'_ mut W

`impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;`
`fn borrow(&self) -> &T`[src]

Immutably borrows from an owned value. Read more

### `impl<T> Any for T where
T: 'static + ?Sized,` [src]

#### `fn type_id(&self) -> TypeId`[src]

Gets the `TypeId` of `self`. Read more

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)