Trait litep2p::executor::Executor

source ·
pub trait Executor: Send + Sync {
    // Required methods
    fn run(&self, future: Pin<Box<dyn Future<Output = ()> + Send>>);
    fn run_with_name(
        &self,
        name: &'static str,
        future: Pin<Box<dyn Future<Output = ()> + Send>>,
    );
}
Expand description

Trait which defines the interface the executor must implement.

Required Methods§

source

fn run(&self, future: Pin<Box<dyn Future<Output = ()> + Send>>)

Start executing a future in the background.

source

fn run_with_name( &self, name: &'static str, future: Pin<Box<dyn Future<Output = ()> + Send>>, )

Start executing a future in the background and give the future a name;

Implementors§