Trait ergo_sync::FinishHandle [] [src]

pub trait FinishHandle<T> where
    T: Send + 'static, 
{ fn finish(self) -> T; }

Convinience trait mimicking std::thread::JoinHandle with better ergonomics.

Required Methods

Finishes the thread, returning the value.

This is the same as JoinHandle::join() except the unwrap is automatic.

Panics

Panics if the thread is poisoned (if a panic happened inside the thread).

Examples

// sleep for half a second
let th = spawn(|| sleep_ms(100));
th.finish(); // as opposed to `th.join().unwrap()`

Implementations on Foreign Types

impl<T: Send + 'static> FinishHandle<T> for JoinHandle<T>
[src]

[src]

Implementors