Spawn

Trait Spawn 

Source
pub trait Spawn {
    // Required method
    fn spawn<F, T>(self, f: F) -> JoinHandle<T>
       where F: FnOnce() -> T + Send + 'static,
             T: Send + 'static;
}

Required Methods§

Source

fn spawn<F, T>(self, f: F) -> JoinHandle<T>
where F: FnOnce() -> T + Send + 'static, T: Send + 'static,

spawn a new coroutine

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.

Implementations on Foreign Types§

Source§

impl Spawn for &str

Source§

fn spawn<F, T>(self, f: F) -> JoinHandle<T>
where F: FnOnce() -> T + Send + 'static, T: Send + 'static,

Source§

impl Spawn for &String

Source§

fn spawn<F, T>(self, f: F) -> JoinHandle<T>
where F: FnOnce() -> T + Send + 'static, T: Send + 'static,

Source§

impl Spawn for (&str, i32)

Source§

fn spawn<F, T>(self, f: F) -> JoinHandle<T>
where F: FnOnce() -> T + Send + 'static, T: Send + 'static,

Source§

impl Spawn for (String, i32)

Source§

fn spawn<F, T>(self, f: F) -> JoinHandle<T>
where F: FnOnce() -> T + Send + 'static, T: Send + 'static,

Source§

impl Spawn for i32

Source§

fn spawn<F, T>(self, f: F) -> JoinHandle<T>
where F: FnOnce() -> T + Send + 'static, T: Send + 'static,

Source§

impl Spawn for String

Source§

fn spawn<F, T>(self, f: F) -> JoinHandle<T>
where F: FnOnce() -> T + Send + 'static, T: Send + 'static,

Implementors§