Trait Spawner

Source
pub trait Spawner: Handler {
    type Handle;

    // Required method
    fn spawn<Fut>(&self, future: Fut) -> Self::Handle
       where Fut: Future<Output = ()> + Send + 'static;
}
Expand description

A task to generalize spawning a future that returns ().

If you use one of the features use_tokio or use_async-std, this will automatically be implemented on you Handler using the appropriate runtime.

If you have a runtime that brings appropriate types, you can implement this on your Handler and use Neovim::new to connect to neovim.

Required Associated Types§

Required Methods§

Source

fn spawn<Fut>(&self, future: Fut) -> Self::Handle
where Fut: Future<Output = ()> + Send + 'static,

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<H> Spawner for H
where H: Handler,

Available on crate feature use_tokio only.