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
sourceimpl<W> Buffer<W> where
W: AsyncWrite + Send + Unpin + 'static,
impl<W> Buffer<W> where
W: AsyncWrite + Send + Unpin + 'static,
pub fn new(code_data: Value, neovim: Neovim<W>) -> Buffer<W>
sourcepub async fn attach(
&self,
send_buffer: bool,
opts: Vec<(Value, Value)>
) -> Result<bool, Box<CallError>>
pub async fn attach(
&self,
send_buffer: bool,
opts: Vec<(Value, Value)>
) -> Result<bool, Box<CallError>>
since: 4
sourcepub async fn get_lines(
&self,
start: i64,
end: i64,
strict_indexing: bool
) -> Result<Vec<String>, Box<CallError>>
pub async fn get_lines(
&self,
start: i64,
end: i64,
strict_indexing: bool
) -> Result<Vec<String>, Box<CallError>>
since: 1
sourcepub async fn set_lines(
&self,
start: i64,
end: i64,
strict_indexing: bool,
replacement: Vec<String>
) -> Result<(), Box<CallError>>
pub async fn set_lines(
&self,
start: i64,
end: i64,
strict_indexing: bool,
replacement: Vec<String>
) -> Result<(), Box<CallError>>
since: 1
sourcepub async fn set_text(
&self,
start_row: i64,
start_col: i64,
end_row: i64,
end_col: i64,
replacement: Vec<String>
) -> Result<(), Box<CallError>>
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
sourcepub async fn get_keymap(
&self,
mode: &str
) -> Result<Vec<Vec<(Value, Value)>>, Box<CallError>>
pub async fn get_keymap(
&self,
mode: &str
) -> Result<Vec<Vec<(Value, Value)>>, Box<CallError>>
since: 3
sourcepub async fn set_keymap(
&self,
mode: &str,
lhs: &str,
rhs: &str,
opts: Vec<(Value, Value)>
) -> Result<(), Box<CallError>>
pub async fn set_keymap(
&self,
mode: &str,
lhs: &str,
rhs: &str,
opts: Vec<(Value, Value)>
) -> Result<(), Box<CallError>>
since: 6
sourcepub async fn get_commands(
&self,
opts: Vec<(Value, Value)>
) -> Result<Vec<(Value, Value)>, Box<CallError>>
pub async fn get_commands(
&self,
opts: Vec<(Value, Value)>
) -> Result<Vec<(Value, Value)>, Box<CallError>>
since: 4
sourcepub async fn set_option(
&self,
name: &str,
value: Value
) -> Result<(), Box<CallError>>
pub async fn set_option(
&self,
name: &str,
value: Value
) -> Result<(), Box<CallError>>
since: 1
sourcepub async fn set_mark(
&self,
name: &str,
line: i64,
col: i64
) -> Result<bool, Box<CallError>>
pub async fn set_mark(
&self,
name: &str,
line: i64,
col: i64
) -> Result<bool, Box<CallError>>
since: 8
sourcepub async fn get_extmark_by_id(
&self,
ns_id: i64,
id: i64,
opts: Vec<(Value, Value)>
) -> Result<Vec<i64>, Box<CallError>>
pub async fn get_extmark_by_id(
&self,
ns_id: i64,
id: i64,
opts: Vec<(Value, Value)>
) -> Result<Vec<i64>, Box<CallError>>
since: 7
sourcepub async fn get_extmarks(
&self,
ns_id: i64,
start: Value,
end: Value,
opts: Vec<(Value, Value)>
) -> Result<Vec<Value>, Box<CallError>>
pub async fn get_extmarks(
&self,
ns_id: i64,
start: Value,
end: Value,
opts: Vec<(Value, Value)>
) -> Result<Vec<Value>, Box<CallError>>
since: 7
sourcepub async fn set_extmark(
&self,
ns_id: i64,
line: i64,
col: i64,
opts: Vec<(Value, Value)>
) -> Result<i64, Box<CallError>>
pub async fn set_extmark(
&self,
ns_id: i64,
line: i64,
col: i64,
opts: Vec<(Value, Value)>
) -> Result<i64, Box<CallError>>
since: 7
sourcepub async fn add_highlight(
&self,
ns_id: i64,
hl_group: &str,
line: i64,
col_start: i64,
col_end: i64
) -> Result<i64, Box<CallError>>
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
sourcepub async fn clear_namespace(
&self,
ns_id: i64,
line_start: i64,
line_end: i64
) -> Result<(), Box<CallError>>
pub async fn clear_namespace(
&self,
ns_id: i64,
line_start: i64,
line_end: i64
) -> Result<(), Box<CallError>>
since: 5
Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more