Struct nvim_rs::neovim::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 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 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 notify( &self, msg: &str, log_level: i64, opts: Vec<(Value, 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 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 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 subscribe(&self, event: &str) -> Result<(), Box<CallError>>

source

pub async fn unsubscribe(&self, event: &str) -> 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 call_atomic( &self, calls: Vec<Value> ) -> 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 complete_set( &self, index: i64, 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 copy 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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> !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> 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,

§

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

§

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

§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V