[][src]Struct humthreads::Thread

pub struct Thread<T: Send + 'static> { /* fields omitted */ }

Handle on a thread returned by Builder::spawn.

Methods

impl<T: Send + 'static> Thread<T>[src]

pub fn join(&self) -> Result<T>[src]

Waits for the associated thread to finish.

If the child thread panics, Err is returned with the parameter given to panic.

pub fn join_timeout(&self, timeout: Duration) -> Result<T>[src]

Similar to Thread::join but does not block forever.

pub fn map<U, F>(self, f: F) -> MapThread<U> where
    U: Send + 'static,
    F: FnMut(T) -> U + 'static, 
[src]

Apply a transformation function when joining to the thread.

pub fn request_shutdown(&self)[src]

Signal the thread is should terminate as soon as possible.

NOTE: you should take precautions when implementing the thread body to periodiaclly check if it needs to terminate or not.

pub fn select_add<'a>(&'a self, select: &mut Select<'a>) -> usize[src]

Add the thread to a Select set.

pub fn select_join(&self, operation: SelectedOperation) -> Result<T>[src]

Completes a join operation that was started by the Select interface.

This method should be used if one of the select operations are used. If the ready familiy of methods is used, use one of the other join methods.

Auto Trait Implementations

impl<T> Send for Thread<T>

impl<T> !Sync for Thread<T>

impl<T> Unpin for Thread<T>

impl<T> !UnwindSafe for Thread<T>

impl<T> !RefUnwindSafe for Thread<T>

Blanket Implementations

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

impl<T> From<T> for 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.

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

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

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