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

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

Auto Trait Implementations§

§

impl<W> Freeze for Buffer<W>

§

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