Thread

Trait Thread 

Source
pub trait Thread<I, O>: Sized + Send
where I: Send + 'static, O: Send + 'static, Self: 'static,
{ // Required methods fn name(&self) -> String; fn thread_body(&mut self, local: ThreadIO<O, I>) -> Result<()>; // Provided methods fn thread_io(&self) -> ThreadIODuplex<I, O> { ... } fn into_thread( self, local: ThreadIO<O, I>, ) -> impl FnOnce() -> Result<()> + Send { ... } fn run(self) -> (ThreadIO<I, O>, JoinHandle<()>) { ... } }

Required Methods§

Source

fn name(&self) -> String

Source

fn thread_body(&mut self, local: ThreadIO<O, I>) -> Result<()>

Provided Methods§

Source

fn thread_io(&self) -> ThreadIODuplex<I, O>

Source

fn into_thread( self, local: ThreadIO<O, I>, ) -> impl FnOnce() -> Result<()> + Send

Source

fn run(self) -> (ThreadIO<I, O>, JoinHandle<()>)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§