Struct Neovim

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

An active Neovim session.

Implementations§

Source§

impl<W> Neovim<W>
where W: AsyncWrite + Send + Unpin + 'static,

Source

pub fn new<H, R>( reader: R, writer: W, handler: H, ) -> (Neovim<<H as Handler>::Writer>, impl Future<Output = Result<(), Box<LoopError>>>)
where R: AsyncRead + Send + Unpin + 'static, H: Handler<Writer = W> + Spawner,

Source

pub async fn handshake<H, R>( reader: R, writer: W, handler: H, message: &str, ) -> Result<(Neovim<<H as Handler>::Writer>, impl Future<Output = Result<(), Box<LoopError>>>), Box<HandshakeError>>
where R: AsyncRead + Send + Unpin + 'static, H: Handler<Writer = W> + Spawner,

Create a new instance, immediately send a handshake message and wait for the response. Unlike new, this function is tolerant to extra data in the reader before the handshake response is received.

message should be a unique string that is normally not found in the stdout. Due to the way Neovim packs strings, the length has to be either less than 20 characters or more than 31 characters long. See https://github.com/neovim/neovim/issues/32784 for more information.

Source

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

Source

pub async fn ui_attach( &self, width: i64, height: i64, opts: &UiAttachOptions, ) -> Result<(), Box<CallError>>

Register as a remote UI.

After this method is called, the client will receive redraw notifications.

Source

pub async fn quit_no_save(&self) -> Result<(), Box<CallError>>

Send a quit command to Nvim. The quit command is ‘qa!’ which will make Nvim quit without saving anything.

Source§

impl<W> Neovim<W>
where W: AsyncWrite + Send + Unpin + 'static,

Source

pub async fn get_autocmds( &self, opts: Vec<(Value, Value)>, ) -> Result<Vec<Value>, Box<CallError>>

Source

pub async fn create_autocmd( &self, event: Value, opts: Vec<(Value, Value)>, ) -> Result<i64, Box<CallError>>

Source

pub async fn del_autocmd(&self, id: i64) -> Result<(), Box<CallError>>

Source

pub async fn clear_autocmds( &self, opts: Vec<(Value, Value)>, ) -> Result<(), Box<CallError>>

Source

pub async fn create_augroup( &self, name: &str, opts: Vec<(Value, Value)>, ) -> Result<i64, Box<CallError>>

Source

pub async fn del_augroup_by_id(&self, id: i64) -> Result<(), Box<CallError>>

Source

pub async fn del_augroup_by_name( &self, name: &str, ) -> Result<(), Box<CallError>>

Source

pub async fn exec_autocmds( &self, event: Value, opts: Vec<(Value, Value)>, ) -> Result<(), Box<CallError>>

Source

pub async fn parse_cmd( &self, str: &str, opts: Vec<(Value, Value)>, ) -> Result<Vec<(Value, Value)>, Box<CallError>>

Source

pub async fn cmd( &self, cmd: Vec<(Value, Value)>, opts: Vec<(Value, Value)>, ) -> Result<String, Box<CallError>>

Source

pub async fn create_user_command( &self, name: &str, command: Value, opts: Vec<(Value, Value)>, ) -> Result<(), Box<CallError>>

Source

pub async fn del_user_command(&self, name: &str) -> Result<(), Box<CallError>>

Source

pub async fn get_commands( &self, opts: Vec<(Value, Value)>, ) -> Result<Vec<(Value, Value)>, Box<CallError>>

Source

pub async fn exec( &self, src: &str, output: bool, ) -> Result<String, Box<CallError>>

Source

pub async fn command_output( &self, command: &str, ) -> Result<String, Box<CallError>>

Source

pub async fn execute_lua( &self, code: &str, args: Vec<Value>, ) -> Result<Value, Box<CallError>>

Source

pub async fn get_hl_by_id( &self, hl_id: i64, rgb: bool, ) -> Result<Vec<(Value, Value)>, Box<CallError>>

Source

pub async fn get_hl_by_name( &self, name: &str, rgb: bool, ) -> Result<Vec<(Value, Value)>, Box<CallError>>

Source

pub async fn get_option_info( &self, name: &str, ) -> Result<Vec<(Value, Value)>, Box<CallError>>

Source

pub async fn set_option( &self, name: &str, value: Value, ) -> Result<(), Box<CallError>>

Source

pub async fn get_option(&self, name: &str) -> Result<Value, Box<CallError>>

Source

pub async fn call_atomic( &self, calls: Vec<Value>, ) -> Result<Vec<Value>, Box<CallError>>

Source

pub async fn subscribe(&self, event: &str) -> Result<(), Box<CallError>>

Source

pub async fn unsubscribe(&self, event: &str) -> Result<(), Box<CallError>>

Source

pub async fn out_write(&self, str: &str) -> Result<(), Box<CallError>>

Source

pub async fn err_write(&self, str: &str) -> Result<(), Box<CallError>>

Source

pub async fn err_writeln(&self, str: &str) -> Result<(), Box<CallError>>

Source

pub async fn notify( &self, msg: &str, log_level: i64, opts: Vec<(Value, Value)>, ) -> Result<Value, Box<CallError>>

Source

pub async fn create_namespace(&self, name: &str) -> Result<i64, Box<CallError>>

Source

pub async fn get_namespaces( &self, ) -> Result<Vec<(Value, Value)>, Box<CallError>>

Source

pub async fn set_decoration_provider( &self, ns_id: i64, opts: Vec<(Value, Value)>, ) -> Result<(), Box<CallError>>

Source

pub async fn get_option_value( &self, name: &str, opts: Vec<(Value, Value)>, ) -> Result<Value, Box<CallError>>

Source

pub async fn set_option_value( &self, name: &str, value: Value, opts: Vec<(Value, Value)>, ) -> Result<(), Box<CallError>>

Source

pub async fn get_all_options_info( &self, ) -> Result<Vec<(Value, Value)>, Box<CallError>>

Source

pub async fn get_option_info2( &self, name: &str, opts: Vec<(Value, Value)>, ) -> Result<Vec<(Value, Value)>, Box<CallError>>

Source

pub async fn ui_set_focus(&self, gained: bool) -> Result<(), Box<CallError>>

Source

pub async fn ui_detach(&self) -> Result<(), Box<CallError>>

Source

pub async fn ui_try_resize( &self, width: i64, height: i64, ) -> Result<(), Box<CallError>>

Source

pub async fn ui_set_option( &self, name: &str, value: Value, ) -> Result<(), Box<CallError>>

Source

pub async fn ui_try_resize_grid( &self, grid: i64, width: i64, height: i64, ) -> Result<(), Box<CallError>>

Source

pub async fn ui_pum_set_height(&self, height: i64) -> Result<(), Box<CallError>>

Source

pub async fn ui_pum_set_bounds( &self, width: f64, height: f64, row: f64, col: f64, ) -> Result<(), Box<CallError>>

Source

pub async fn ui_term_event( &self, event: &str, value: Value, ) -> Result<(), Box<CallError>>

Source

pub async fn get_hl_id_by_name(&self, name: &str) -> Result<i64, Box<CallError>>

Source

pub async fn get_hl( &self, ns_id: i64, opts: Vec<(Value, Value)>, ) -> Result<Vec<(Value, Value)>, Box<CallError>>

Source

pub async fn set_hl( &self, ns_id: i64, name: &str, val: Vec<(Value, Value)>, ) -> Result<(), Box<CallError>>

Source

pub async fn get_hl_ns( &self, opts: Vec<(Value, Value)>, ) -> Result<i64, Box<CallError>>

Source

pub async fn set_hl_ns(&self, ns_id: i64) -> Result<(), Box<CallError>>

Source

pub async fn set_hl_ns_fast(&self, ns_id: i64) -> Result<(), Box<CallError>>

Source

pub async fn feedkeys( &self, keys: &str, mode: &str, escape_ks: bool, ) -> Result<(), Box<CallError>>

Source

pub async fn input(&self, keys: &str) -> Result<i64, Box<CallError>>

Source

pub async fn input_mouse( &self, button: &str, action: &str, modifier: &str, grid: i64, row: i64, col: i64, ) -> Result<(), Box<CallError>>

Source

pub async fn replace_termcodes( &self, str: &str, from_part: bool, do_lt: bool, special: bool, ) -> Result<String, Box<CallError>>

Source

pub async fn exec_lua( &self, code: &str, args: Vec<Value>, ) -> Result<Value, Box<CallError>>

Source

pub async fn strwidth(&self, text: &str) -> Result<i64, Box<CallError>>

Source

pub async fn list_runtime_paths(&self) -> Result<Vec<String>, Box<CallError>>

Source

pub async fn get_runtime_file( &self, name: &str, all: bool, ) -> Result<Vec<String>, Box<CallError>>

Source

pub async fn set_current_dir(&self, dir: &str) -> Result<(), Box<CallError>>

Source

pub async fn get_current_line(&self) -> Result<String, Box<CallError>>

Source

pub async fn set_current_line(&self, line: &str) -> Result<(), Box<CallError>>

Source

pub async fn del_current_line(&self) -> Result<(), Box<CallError>>

Source

pub async fn get_var(&self, name: &str) -> Result<Value, Box<CallError>>

Source

pub async fn set_var( &self, name: &str, value: Value, ) -> Result<(), Box<CallError>>

Source

pub async fn del_var(&self, name: &str) -> Result<(), Box<CallError>>

Source

pub async fn get_vvar(&self, name: &str) -> Result<Value, Box<CallError>>

Source

pub async fn set_vvar( &self, name: &str, value: Value, ) -> Result<(), Box<CallError>>

Source

pub async fn echo( &self, chunks: Vec<Value>, history: bool, opts: Vec<(Value, Value)>, ) -> Result<(), Box<CallError>>

Source

pub async fn set_current_buf( &self, buffer: &Buffer<W>, ) -> Result<(), Box<CallError>>

Source

pub async fn set_current_win( &self, window: &Window<W>, ) -> Result<(), Box<CallError>>

Source

pub async fn open_term( &self, buffer: &Buffer<W>, opts: Vec<(Value, Value)>, ) -> Result<i64, Box<CallError>>

Source

pub async fn chan_send( &self, chan: i64, data: &str, ) -> Result<(), Box<CallError>>

Source

pub async fn set_current_tabpage( &self, tabpage: &Tabpage<W>, ) -> Result<(), Box<CallError>>

Source

pub async fn paste( &self, data: &str, crlf: bool, phase: i64, ) -> Result<bool, Box<CallError>>

Source

pub async fn put( &self, lines: Vec<String>, typ: &str, after: bool, follow: bool, ) -> Result<(), Box<CallError>>

Source

pub async fn get_color_by_name(&self, name: &str) -> Result<i64, Box<CallError>>

Source

pub async fn get_color_map(&self) -> Result<Vec<(Value, Value)>, Box<CallError>>

Source

pub async fn get_context( &self, opts: Vec<(Value, Value)>, ) -> Result<Vec<(Value, Value)>, Box<CallError>>

Source

pub async fn load_context( &self, dict: Vec<(Value, Value)>, ) -> Result<Value, Box<CallError>>

Source

pub async fn get_mode(&self) -> Result<Vec<(Value, Value)>, Box<CallError>>

Source

pub async fn get_keymap( &self, mode: &str, ) -> Result<Vec<Vec<(Value, Value)>>, Box<CallError>>

Source

pub async fn set_keymap( &self, mode: &str, lhs: &str, rhs: &str, opts: Vec<(Value, Value)>, ) -> Result<(), Box<CallError>>

Source

pub async fn del_keymap( &self, mode: &str, lhs: &str, ) -> Result<(), Box<CallError>>

Source

pub async fn get_api_info(&self) -> Result<Vec<Value>, Box<CallError>>

Source

pub async fn set_client_info( &self, name: &str, version: Vec<(Value, Value)>, typ: &str, methods: Vec<(Value, Value)>, attributes: Vec<(Value, Value)>, ) -> Result<(), Box<CallError>>

Source

pub async fn get_chan_info( &self, chan: i64, ) -> Result<Vec<(Value, Value)>, Box<CallError>>

Source

pub async fn list_chans(&self) -> Result<Vec<Value>, Box<CallError>>

Source

pub async fn list_uis(&self) -> Result<Vec<Value>, Box<CallError>>

Source

pub async fn get_proc_children( &self, pid: i64, ) -> Result<Vec<Value>, Box<CallError>>

Source

pub async fn get_proc(&self, pid: i64) -> Result<Value, Box<CallError>>

Source

pub async fn select_popupmenu_item( &self, item: i64, insert: bool, finish: bool, opts: Vec<(Value, Value)>, ) -> Result<(), Box<CallError>>

Source

pub async fn del_mark(&self, name: &str) -> Result<bool, Box<CallError>>

Source

pub async fn get_mark( &self, name: &str, opts: Vec<(Value, Value)>, ) -> Result<Vec<Value>, Box<CallError>>

Source

pub async fn eval_statusline( &self, str: &str, opts: Vec<(Value, Value)>, ) -> Result<Vec<(Value, Value)>, Box<CallError>>

Source

pub async fn exec2( &self, src: &str, opts: Vec<(Value, Value)>, ) -> Result<Vec<(Value, Value)>, Box<CallError>>

Source

pub async fn command(&self, command: &str) -> Result<(), Box<CallError>>

Source

pub async fn eval(&self, expr: &str) -> Result<Value, Box<CallError>>

Source

pub async fn call_function( &self, fname: &str, args: Vec<Value>, ) -> Result<Value, Box<CallError>>

Source

pub async fn call_dict_function( &self, dict: Value, fname: &str, args: Vec<Value>, ) -> Result<Value, Box<CallError>>

Source

pub async fn parse_expression( &self, expr: &str, flags: &str, highlight: bool, ) -> Result<Vec<(Value, Value)>, Box<CallError>>

Source§

impl<W> Neovim<W>
where W: AsyncWrite + Send + Unpin + 'static,

Source

pub async fn list_bufs(&self) -> Result<Vec<Buffer<W>>, Box<CallError>>

Source

pub async fn get_current_buf(&self) -> Result<Buffer<W>, Box<CallError>>

Source

pub async fn list_wins(&self) -> Result<Vec<Window<W>>, Box<CallError>>

Source

pub async fn get_current_win(&self) -> Result<Window<W>, Box<CallError>>

Source

pub async fn create_buf( &self, listed: bool, scratch: bool, ) -> Result<Buffer<W>, Box<CallError>>

Source

pub async fn open_win( &self, buffer: &Buffer<W>, enter: bool, config: Vec<(Value, Value)>, ) -> Result<Window<W>, Box<CallError>>

Source

pub async fn list_tabpages(&self) -> Result<Vec<Tabpage<W>>, Box<CallError>>

Source

pub async fn get_current_tabpage(&self) -> Result<Tabpage<W>, Box<CallError>>

Trait Implementations§

Source§

impl<W> Clone for Neovim<W>
where W: AsyncWrite + Send + 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<W> PartialEq for Neovim<W>
where W: AsyncWrite + Send + Unpin + 'static,

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<W> Eq for Neovim<W>
where W: AsyncWrite + Send + Unpin + 'static,

Auto Trait Implementations§

§

impl<W> Freeze for Neovim<W>

§

impl<W> !RefUnwindSafe for Neovim<W>

§

impl<W> Send for Neovim<W>

§

impl<W> Sync for Neovim<W>

§

impl<W> Unpin for Neovim<W>

§

impl<W> !UnwindSafe for Neovim<W>

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