[−][src]Struct humthreads::Thread
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]
U: Send + 'static,
F: FnMut(T) -> U + 'static,
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]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,