pub struct Session { /* private fields */ }
Expand description
An active Neovim session.
Implementations§
Source§impl Session
impl Session
Sourcepub fn new_unix_socket<P: AsRef<Path>>(path: P) -> Result<Session>
pub fn new_unix_socket<P: AsRef<Path>>(path: P) -> Result<Session>
Connect to nvim instance via unix socket
Sourcepub fn new_child_path<S: AsRef<Path>>(program: S) -> Result<Session>
pub fn new_child_path<S: AsRef<Path>>(program: S) -> Result<Session>
Connect to a Neovim instance by spawning a new one
Sourcepub fn new_child_cmd(cmd: &mut Command) -> Result<Session>
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()
Sourcepub fn new_parent() -> Result<Session>
pub fn new_parent() -> Result<Session>
Connect to a Neovim instance that spawned this process over stdin/stdout.
Sourcepub fn set_timeout(&mut self, timeout: Duration)
pub fn set_timeout(&mut self, timeout: Duration)
Set call timeout
pub fn set_infinity_timeout(&mut self)
Sourcepub fn start_event_loop_channel_handler<H>(
&mut self,
request_handler: H,
) -> Receiver<(String, Vec<Value>)>where
H: RequestHandler + Send + 'static,
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
Sourcepub fn start_event_loop_channel(&mut self) -> Receiver<(String, Vec<Value>)>
pub fn start_event_loop_channel(&mut self) -> Receiver<(String, Vec<Value>)>
Start processing rpc response and notifications
Sourcepub fn start_event_loop_handler<H>(&mut self, handler: H)
pub fn start_event_loop_handler<H>(&mut self, handler: H)
Start processing rpc response and notifications
Sourcepub fn start_event_loop(&mut self)
pub fn start_event_loop(&mut self)
Start processing rpc response and notifications
Sourcepub fn call(&mut self, method: &str, args: Vec<Value>) -> Result<Value, Value>
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
Sourcepub fn call_async<R: FromVal<Value>>(
&mut self,
method: &str,
args: Vec<Value>,
) -> AsyncCall<'_, R>
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.
Sourcepub fn take_dispatch_guard(&mut self) -> JoinHandle<()>
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§
impl Freeze for Session
impl !RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl !UnwindSafe for Session
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more