[][src]Struct rusty_pool::JoinHandle

pub struct JoinHandle<T: Send> { /* fields omitted */ }

Handle returned by ThreadPool::evaluate and ThreadPool::complete that allows to block the current thread and wait for the result of a submitted task. The returned JoinHandle may also be sent to the ThreadPool to create a task that blocks a worker thread until the task is completed and then does something with the result. This handle communicates with the worker thread using a oneshot channel blocking the thread when try_await_complete() is called until a message, i.e. the result of the task, is received.

Implementations

impl<T: Send> JoinHandle<T>[src]

pub fn try_await_complete(self) -> Result<T, Canceled>[src]

Block the current thread until the result of the task is received.

Errors

This function might return a oneshot::Canceled if the channel was broken before the result was received. This is generally the case if execution of the task panicked.

pub fn await_complete(self) -> T[src]

Block the current thread until the result of the task is received.

Panics

This function might panic if try_await_complete() returns oneshot::Canceled. This is generally the case if execution of the task panicked and the sender was dropped before sending a result to the receiver.

Auto Trait Implementations

impl<T> !RefUnwindSafe for JoinHandle<T>

impl<T> Send for JoinHandle<T>

impl<T> Sync for JoinHandle<T>

impl<T> Unpin for JoinHandle<T>

impl<T> !UnwindSafe for JoinHandle<T>

Blanket Implementations

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

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

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

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

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

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.

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.