Trait ThreadManager

Source
pub trait ThreadManager<'env> {
    type Handle: Join;

    // Required method
    fn spawn_thread<F: FnOnce() + Send + 'env>(&self, func: F) -> Self::Handle;
}
Expand description

Trait to handle spawning generic threads.

Required Associated Types§

Source

type Handle: Join

The type of thread handle (must have a join() function).

Required Methods§

Source

fn spawn_thread<F: FnOnce() + Send + 'env>(&self, func: F) -> Self::Handle

Spawns a thread using this manager.

§Arguments
  • func: the function to run in the thread.

returns: Self::Handle

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§

Source§

impl ThreadManager<'static> for UnscopedThreadManager

Source§

impl<'env, 'scope: 'env> ThreadManager<'scope> for ScopedThreadManager<'env, 'scope>