pub struct Session {
pub metadata: Metadata,
/* private fields */
}
Expand description
An active Neovim session.
Fields§
§metadata: Metadata
Implementations§
Source§impl Session
impl Session
Sourcepub fn new_tcp<A: ToSocketAddrs>(addr: A) -> Result<Session>
pub fn new_tcp<A: ToSocketAddrs>(addr: A) -> Result<Session>
Connect to a Neovim instance over TCP.
Sourcepub fn new_stdio() -> Session
pub fn new_stdio() -> Session
Connect to a Neovim instance using this process’ standard input and output. Useful if Neovim started this process.
Sourcepub fn new_child(args: &[String]) -> Result<Session>
pub fn new_child(args: &[String]) -> Result<Session>
Connect to a Neovim instance by spawning a new one. Automatically passes --embed
as a command-line parameter.
Uses nvim
as the default command for launching Neovim, but this can be overridden
with the NVIM_BIN
environment variable.
Sourcepub fn new_socket()
pub fn new_socket()
Connect to a Neovim instance over a Unix socket. Currently unimplemented.
Sourcepub fn call(
&mut self,
method: String,
params: Vec<Value>,
) -> Result<Receiver<RpcResult>, WriteError>
pub fn call( &mut self, method: String, params: Vec<Value>, ) -> Result<Receiver<RpcResult>, WriteError>
Call a method over RPC.
Sourcepub fn call_sync(
&mut self,
method: String,
params: Vec<Value>,
) -> Result<RpcResult, WriteError>
pub fn call_sync( &mut self, method: String, params: Vec<Value>, ) -> Result<RpcResult, WriteError>
Call a method over RPC, synchronously.
Sourcepub fn socket_addr(&self) -> Option<&SocketAddr>
pub fn socket_addr(&self) -> Option<&SocketAddr>
Returns a reference to the TCP socket address used by this session.
If the connection isn’t over TCP, this method returns None.
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