pub struct Neovim<W>{ /* private fields */ }
Expand description
An active Neovim session.
Implementations§
Source§impl<W> Neovim<W>
impl<W> Neovim<W>
pub fn new<H, R>( reader: R, writer: W, handler: H, ) -> (Neovim<<H as Handler>::Writer>, impl Future<Output = Result<(), Box<LoopError>>>)
Sourcepub 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>>
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>>
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.
pub async fn call( &self, method: &str, args: Vec<Value>, ) -> Result<Result<Value, Value>, Box<CallError>>
Source§impl<W> Neovim<W>
impl<W> Neovim<W>
pub async fn get_autocmds( &self, opts: Vec<(Value, Value)>, ) -> Result<Vec<Value>, Box<CallError>>
pub async fn create_autocmd( &self, event: Value, opts: Vec<(Value, Value)>, ) -> Result<i64, Box<CallError>>
pub async fn del_autocmd(&self, id: i64) -> Result<(), Box<CallError>>
pub async fn clear_autocmds( &self, opts: Vec<(Value, Value)>, ) -> Result<(), Box<CallError>>
pub async fn create_augroup( &self, name: &str, opts: Vec<(Value, Value)>, ) -> Result<i64, Box<CallError>>
pub async fn del_augroup_by_id(&self, id: i64) -> Result<(), Box<CallError>>
pub async fn del_augroup_by_name( &self, name: &str, ) -> Result<(), Box<CallError>>
pub async fn exec_autocmds( &self, event: Value, opts: Vec<(Value, Value)>, ) -> Result<(), Box<CallError>>
pub async fn parse_cmd( &self, str: &str, opts: Vec<(Value, Value)>, ) -> Result<Vec<(Value, Value)>, Box<CallError>>
pub async fn cmd( &self, cmd: Vec<(Value, Value)>, opts: Vec<(Value, Value)>, ) -> Result<String, Box<CallError>>
pub async fn create_user_command( &self, name: &str, command: Value, opts: Vec<(Value, Value)>, ) -> Result<(), Box<CallError>>
pub async fn del_user_command(&self, name: &str) -> Result<(), Box<CallError>>
pub async fn get_commands( &self, opts: Vec<(Value, Value)>, ) -> Result<Vec<(Value, Value)>, Box<CallError>>
pub async fn exec( &self, src: &str, output: bool, ) -> Result<String, Box<CallError>>
pub async fn command_output( &self, command: &str, ) -> Result<String, Box<CallError>>
pub async fn execute_lua( &self, code: &str, args: Vec<Value>, ) -> Result<Value, Box<CallError>>
pub async fn get_hl_by_id( &self, hl_id: i64, rgb: bool, ) -> Result<Vec<(Value, Value)>, Box<CallError>>
pub async fn get_hl_by_name( &self, name: &str, rgb: bool, ) -> Result<Vec<(Value, Value)>, Box<CallError>>
pub async fn get_option_info( &self, name: &str, ) -> Result<Vec<(Value, Value)>, Box<CallError>>
pub async fn set_option( &self, name: &str, value: Value, ) -> Result<(), Box<CallError>>
pub async fn get_option(&self, name: &str) -> Result<Value, Box<CallError>>
pub async fn call_atomic( &self, calls: Vec<Value>, ) -> Result<Vec<Value>, Box<CallError>>
pub async fn subscribe(&self, event: &str) -> Result<(), Box<CallError>>
pub async fn unsubscribe(&self, event: &str) -> Result<(), Box<CallError>>
pub async fn out_write(&self, str: &str) -> Result<(), Box<CallError>>
pub async fn err_write(&self, str: &str) -> Result<(), Box<CallError>>
pub async fn err_writeln(&self, str: &str) -> Result<(), Box<CallError>>
pub async fn notify( &self, msg: &str, log_level: i64, opts: Vec<(Value, Value)>, ) -> Result<Value, Box<CallError>>
pub async fn create_namespace(&self, name: &str) -> Result<i64, Box<CallError>>
pub async fn get_namespaces( &self, ) -> Result<Vec<(Value, Value)>, Box<CallError>>
pub async fn set_decoration_provider( &self, ns_id: i64, opts: Vec<(Value, Value)>, ) -> Result<(), Box<CallError>>
pub async fn get_option_value( &self, name: &str, opts: Vec<(Value, Value)>, ) -> Result<Value, Box<CallError>>
pub async fn set_option_value( &self, name: &str, value: Value, opts: Vec<(Value, Value)>, ) -> Result<(), Box<CallError>>
pub async fn get_all_options_info( &self, ) -> Result<Vec<(Value, Value)>, Box<CallError>>
pub async fn get_option_info2( &self, name: &str, opts: Vec<(Value, Value)>, ) -> Result<Vec<(Value, Value)>, Box<CallError>>
pub async fn ui_set_focus(&self, gained: bool) -> Result<(), Box<CallError>>
pub async fn ui_detach(&self) -> Result<(), Box<CallError>>
pub async fn ui_try_resize( &self, width: i64, height: i64, ) -> Result<(), Box<CallError>>
pub async fn ui_set_option( &self, name: &str, value: Value, ) -> Result<(), Box<CallError>>
pub async fn ui_try_resize_grid( &self, grid: i64, width: i64, height: i64, ) -> Result<(), Box<CallError>>
pub async fn ui_pum_set_height(&self, height: i64) -> Result<(), Box<CallError>>
pub async fn ui_pum_set_bounds( &self, width: f64, height: f64, row: f64, col: f64, ) -> Result<(), Box<CallError>>
pub async fn ui_term_event( &self, event: &str, value: Value, ) -> Result<(), Box<CallError>>
pub async fn get_hl_id_by_name(&self, name: &str) -> Result<i64, Box<CallError>>
pub async fn get_hl( &self, ns_id: i64, opts: Vec<(Value, Value)>, ) -> Result<Vec<(Value, Value)>, Box<CallError>>
pub async fn set_hl( &self, ns_id: i64, name: &str, val: Vec<(Value, Value)>, ) -> Result<(), Box<CallError>>
pub async fn get_hl_ns( &self, opts: Vec<(Value, Value)>, ) -> Result<i64, Box<CallError>>
pub async fn set_hl_ns(&self, ns_id: i64) -> Result<(), Box<CallError>>
pub async fn set_hl_ns_fast(&self, ns_id: i64) -> Result<(), Box<CallError>>
pub async fn feedkeys( &self, keys: &str, mode: &str, escape_ks: bool, ) -> Result<(), Box<CallError>>
pub async fn input(&self, keys: &str) -> Result<i64, Box<CallError>>
pub async fn input_mouse( &self, button: &str, action: &str, modifier: &str, grid: i64, row: i64, col: i64, ) -> Result<(), Box<CallError>>
pub async fn replace_termcodes( &self, str: &str, from_part: bool, do_lt: bool, special: bool, ) -> Result<String, Box<CallError>>
pub async fn exec_lua( &self, code: &str, args: Vec<Value>, ) -> Result<Value, Box<CallError>>
pub async fn strwidth(&self, text: &str) -> Result<i64, Box<CallError>>
pub async fn list_runtime_paths(&self) -> Result<Vec<String>, Box<CallError>>
pub async fn get_runtime_file( &self, name: &str, all: bool, ) -> Result<Vec<String>, Box<CallError>>
pub async fn set_current_dir(&self, dir: &str) -> Result<(), Box<CallError>>
pub async fn get_current_line(&self) -> Result<String, Box<CallError>>
pub async fn set_current_line(&self, line: &str) -> Result<(), Box<CallError>>
pub async fn del_current_line(&self) -> Result<(), Box<CallError>>
pub async fn get_var(&self, name: &str) -> Result<Value, Box<CallError>>
pub async fn set_var( &self, name: &str, value: Value, ) -> Result<(), Box<CallError>>
pub async fn del_var(&self, name: &str) -> Result<(), Box<CallError>>
pub async fn get_vvar(&self, name: &str) -> Result<Value, Box<CallError>>
pub async fn set_vvar( &self, name: &str, value: Value, ) -> Result<(), Box<CallError>>
pub async fn echo( &self, chunks: Vec<Value>, history: bool, opts: Vec<(Value, Value)>, ) -> Result<(), Box<CallError>>
pub async fn set_current_buf( &self, buffer: &Buffer<W>, ) -> Result<(), Box<CallError>>
pub async fn set_current_win( &self, window: &Window<W>, ) -> Result<(), Box<CallError>>
pub async fn open_term( &self, buffer: &Buffer<W>, opts: Vec<(Value, Value)>, ) -> Result<i64, Box<CallError>>
pub async fn chan_send( &self, chan: i64, data: &str, ) -> Result<(), Box<CallError>>
pub async fn set_current_tabpage( &self, tabpage: &Tabpage<W>, ) -> Result<(), Box<CallError>>
pub async fn paste( &self, data: &str, crlf: bool, phase: i64, ) -> Result<bool, Box<CallError>>
pub async fn put( &self, lines: Vec<String>, typ: &str, after: bool, follow: bool, ) -> Result<(), Box<CallError>>
pub async fn get_color_by_name(&self, name: &str) -> Result<i64, Box<CallError>>
pub async fn get_color_map(&self) -> Result<Vec<(Value, Value)>, Box<CallError>>
pub async fn get_context( &self, opts: Vec<(Value, Value)>, ) -> Result<Vec<(Value, Value)>, Box<CallError>>
pub async fn load_context( &self, dict: Vec<(Value, Value)>, ) -> Result<Value, Box<CallError>>
pub async fn get_mode(&self) -> Result<Vec<(Value, Value)>, Box<CallError>>
pub async fn get_keymap( &self, mode: &str, ) -> Result<Vec<Vec<(Value, Value)>>, Box<CallError>>
pub async fn set_keymap( &self, mode: &str, lhs: &str, rhs: &str, opts: Vec<(Value, Value)>, ) -> Result<(), Box<CallError>>
pub async fn del_keymap( &self, mode: &str, lhs: &str, ) -> Result<(), Box<CallError>>
pub async fn get_api_info(&self) -> Result<Vec<Value>, Box<CallError>>
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>>
pub async fn get_chan_info( &self, chan: i64, ) -> Result<Vec<(Value, Value)>, Box<CallError>>
pub async fn list_chans(&self) -> Result<Vec<Value>, Box<CallError>>
pub async fn list_uis(&self) -> Result<Vec<Value>, Box<CallError>>
pub async fn get_proc_children( &self, pid: i64, ) -> Result<Vec<Value>, Box<CallError>>
pub async fn get_proc(&self, pid: i64) -> Result<Value, Box<CallError>>
pub async fn del_mark(&self, name: &str) -> Result<bool, Box<CallError>>
pub async fn get_mark( &self, name: &str, opts: Vec<(Value, Value)>, ) -> Result<Vec<Value>, Box<CallError>>
pub async fn eval_statusline( &self, str: &str, opts: Vec<(Value, Value)>, ) -> Result<Vec<(Value, Value)>, Box<CallError>>
pub async fn exec2( &self, src: &str, opts: Vec<(Value, Value)>, ) -> Result<Vec<(Value, Value)>, Box<CallError>>
pub async fn command(&self, command: &str) -> Result<(), Box<CallError>>
pub async fn eval(&self, expr: &str) -> Result<Value, Box<CallError>>
pub async fn call_function( &self, fname: &str, args: Vec<Value>, ) -> Result<Value, Box<CallError>>
pub async fn call_dict_function( &self, dict: Value, fname: &str, args: Vec<Value>, ) -> Result<Value, Box<CallError>>
pub async fn parse_expression( &self, expr: &str, flags: &str, highlight: bool, ) -> Result<Vec<(Value, Value)>, Box<CallError>>
Source§impl<W> Neovim<W>
impl<W> Neovim<W>
pub async fn list_bufs(&self) -> Result<Vec<Buffer<W>>, Box<CallError>>
pub async fn get_current_buf(&self) -> Result<Buffer<W>, Box<CallError>>
pub async fn list_wins(&self) -> Result<Vec<Window<W>>, Box<CallError>>
pub async fn get_current_win(&self) -> Result<Window<W>, Box<CallError>>
pub async fn create_buf( &self, listed: bool, scratch: bool, ) -> Result<Buffer<W>, Box<CallError>>
pub async fn open_win( &self, buffer: &Buffer<W>, enter: bool, config: Vec<(Value, Value)>, ) -> Result<Window<W>, Box<CallError>>
pub async fn list_tabpages(&self) -> Result<Vec<Tabpage<W>>, Box<CallError>>
pub async fn get_current_tabpage(&self) -> Result<Tabpage<W>, Box<CallError>>
Trait Implementations§
impl<W> Eq for Neovim<W>
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> 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