Trait nvim_rs::rpc::handler::Handler[][src]

pub trait Handler: Send + Sync + Clone + 'static {
    type Writer: AsyncWrite + Send + Unpin + 'static;
    fn handle_request<'life0, 'async_trait>(
        &'life0 self,
        _name: String,
        _args: Vec<Value>,
        _neovim: Neovim<Self::Writer>
    ) -> Pin<Box<dyn Future<Output = Result<Value, Value>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... }
fn handle_notify<'life0, 'async_trait>(
        &'life0 self,
        _name: String,
        _args: Vec<Value>,
        _neovim: Neovim<<Self as Handler>::Writer>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } }
Expand description

The central functionality of a plugin. The trait bounds asure that each asynchronous task can receive a copy of the handler, so some state can be shared.

Associated Types

The type where we write our responses to requests. Handling of incoming requests/notifications is done on the io loop, which passes the parsed messages to the handler.

Provided methods

Handling an rpc request. The ID’s of requests are handled by the neovim instance.

Handling an rpc notification. Notifications are handled one at a time in the order in which they were received, and will block new requests from being received until handle_notify returns.

Implementors