Struct nvim_rs::exttypes::Buffer

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

A struct representing a neovim buffer. It is specific to a Neovim instance, and calling a method on it will always use this instance.

Implementations§

source§

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

source

pub fn new(code_data: Value, neovim: Neovim<W>) -> Buffer<W>

source

pub fn get_value(&self) -> &Value

Internal value, that represent type

source

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

since: 1

source

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

since: 4

source

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

since: 4

source

pub async fn get_lines( &self, start: i64, end: i64, strict_indexing: bool ) -> Result<Vec<String>, Box<CallError>>

since: 1

source

pub async fn set_lines( &self, start: i64, end: i64, strict_indexing: bool, replacement: Vec<String> ) -> Result<(), Box<CallError>>

since: 1

source

pub async fn set_text( &self, start_row: i64, start_col: i64, end_row: i64, end_col: i64, replacement: Vec<String> ) -> Result<(), Box<CallError>>

since: 7

source

pub async fn get_text( &self, start_row: i64, start_col: i64, end_row: i64, end_col: i64, opts: Vec<(Value, Value)> ) -> Result<Vec<String>, Box<CallError>>

since: 9

source

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

since: 5

source

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

since: 1

source

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

since: 2

source

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

since: 3

source

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

since: 6

source

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

since: 6

source

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

since: 1

source

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

since: 1

source

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

since: 1

source

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

since: 1

source

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

since: 5

source

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

since: 7

source

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

since: 1

source

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

since: 8

source

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

since: 8

source

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

since: 1

source

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

since: 9

source

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

since: 9

source

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

since: 4

source

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

since: 1

source

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

since: 1

source

pub async fn set_virtual_text( &self, src_id: i64, line: i64, chunks: Vec<Value>, opts: Vec<(Value, Value)> ) -> Result<i64, Box<CallError>>

since: 5

source

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

since: 1

source

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

since: 1

source

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

since: 7

source

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

since: 7

source

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

since: 7

source

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

since: 7

source

pub async fn add_highlight( &self, ns_id: i64, hl_group: &str, line: i64, col_start: i64, col_end: i64 ) -> Result<i64, Box<CallError>>

since: 1

source

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

since: 5

Trait Implementations§

source§

impl<W> Clone for Buffer<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> IntoVal<Value> for &Buffer<W>
where W: AsyncWrite + Send + Unpin + 'static,

source§

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

Auto Trait Implementations§

§

impl<W> !RefUnwindSafe for Buffer<W>

§

impl<W> Send for Buffer<W>

§

impl<W> Sync for Buffer<W>

§

impl<W> Unpin for Buffer<W>

§

impl<W> !UnwindSafe for Buffer<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