pub trait Thread<I, O>: Sized + Send{
// 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§
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<()>)
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.