Struct Session

Source
pub struct Session { /* private fields */ }
Expand description

An active Neovim session.

Implementations§

Source§

impl Session

Source

pub fn new_tcp(addr: &str) -> Result<Session>

Connect to nvim instance via tcp

Source

pub fn new_unix_socket<P: AsRef<Path>>(path: P) -> Result<Session>

Connect to nvim instance via unix socket

Source

pub fn new_child() -> Result<Session>

Connect to a Neovim instance by spawning a new one.

Source

pub fn new_child_path<S: AsRef<Path>>(program: S) -> Result<Session>

Connect to a Neovim instance by spawning a new one

Source

pub fn new_child_cmd(cmd: &mut Command) -> Result<Session>

Connect to a Neovim instance by spawning a new one

stdin/stdout settings will be rewrited to Stdio::piped()

Source

pub fn new_parent() -> Result<Session>

Connect to a Neovim instance that spawned this process over stdin/stdout.

Source

pub fn set_timeout(&mut self, timeout: Duration)

Set call timeout

Source

pub fn set_infinity_timeout(&mut self)

Source

pub fn start_event_loop_channel_handler<H>( &mut self, request_handler: H, ) -> Receiver<(String, Vec<Value>)>
where H: RequestHandler + Send + 'static,

Start processing rpc response and notifications

Source

pub fn start_event_loop_channel(&mut self) -> Receiver<(String, Vec<Value>)>

Start processing rpc response and notifications

Source

pub fn start_event_loop_handler<H>(&mut self, handler: H)
where H: Handler + Send + 'static,

Start processing rpc response and notifications

Source

pub fn start_event_loop(&mut self)

Start processing rpc response and notifications

Source

pub fn call(&mut self, method: &str, args: Vec<Value>) -> Result<Value, Value>

Sync call. Call can be made only after event loop begin processing

Source

pub fn call_async<R: FromVal<Value>>( &mut self, method: &str, args: Vec<Value>, ) -> AsyncCall<'_, R>

Create async call will be executed when only after call() function.

Source

pub fn take_dispatch_guard(&mut self) -> JoinHandle<()>

Wait dispatch thread to finish.

This can happens in case child process connection is lost for some reason.

Auto Trait Implementations§

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