Skip to main content

Spawn

Trait Spawn 

Source
pub trait Spawn<F>: 'static
where F: Future + 'static,
{ // Required method fn spawn(&mut self, future: F); }
Expand description

A strategy for spawning futures.

Notably, Send is not required at the Spawn level. If you have a non-Send service, you can implement your own Spawn.

Required Methods§

Source

fn spawn(&mut self, future: F)

Spawn a connection driver task and a connection server task.

Implementors§

Source§

impl<F> Spawn<F> for LevelSpawn<F>
where F: Future + Send + 'static, F::Output: Send + 'static,

Source§

impl<F> Spawn<F> for TokioSpawn<F>
where F: Future + Send + 'static, F::Output: Send + 'static,