Struct Dummy

Source
pub struct Dummy<Q>
where Q: AsyncWrite + Send + Sync + Unpin + 'static,
{ /* private fields */ }
Expand description

The dummy handler defaults to doing nothing with a notification, and returning a generic error for a request. It can be used if a plugin only wants to send requests to neovim and get responses, but not handle any notifications or requests.

Implementations§

Source§

impl<Q> Dummy<Q>
where Q: AsyncWrite + Send + Sync + Unpin + 'static,

Source

pub fn new() -> Dummy<Q>

Trait Implementations§

Source§

impl<Q> Clone for Dummy<Q>
where Q: AsyncWrite + Send + Sync + Unpin + 'static,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Q> Default for Dummy<Q>
where Q: AsyncWrite + Send + Sync + Unpin + 'static + Default,

Source§

fn default() -> Dummy<Q>

Returns the “default value” for a type. Read more
Source§

impl<Q> Handler for Dummy<Q>
where Q: AsyncWrite + Send + Sync + Unpin + 'static,

Source§

type Writer = Q

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.
Source§

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 Self: 'async_trait, 'life0: 'async_trait,

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

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 Self: 'async_trait, 'life0: 'async_trait,

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.

Auto Trait Implementations§

§

impl<Q> Freeze for Dummy<Q>

§

impl<Q> RefUnwindSafe for Dummy<Q>
where Q: RefUnwindSafe,

§

impl<Q> Send for Dummy<Q>

§

impl<Q> Sync for Dummy<Q>

§

impl<Q> Unpin for Dummy<Q>

§

impl<Q> UnwindSafe for Dummy<Q>
where Q: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<H> Spawner for H
where H: Handler,

Source§

type Handle = JoinHandle<()>

Source§

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.