pub struct Window(_);Expand description
A newtype struct wrapping a Neovim window. All the nvim_win_* functions
taking a window handle as their first argument are implemented as methods
on this object.
Implementations
sourceimpl Window
impl Window
sourcepub fn get_config(&self) -> Result<WindowConfig>
pub fn get_config(&self) -> Result<WindowConfig>
Binding to nvim_win_get_config.
Gets the window configuration.
sourcepub fn set_config(&mut self, config: &WindowConfig) -> Result<()>
pub fn set_config(&mut self, config: &WindowConfig) -> Result<()>
Binding to nvim_win_get_config.
Configures the window layout. Only for floating and external windows.
sourceimpl Window
impl Window
sourcepub fn current() -> Self
pub fn current() -> Self
Shorthand for api::get_current_win.
sourcepub fn call<R, F>(&self, fun: F) -> Result<R> where
F: FnOnce(()) -> Result<R> + 'static,
R: ToObject + FromObject,
pub fn call<R, F>(&self, fun: F) -> Result<R> where
F: FnOnce(()) -> Result<R> + 'static,
R: ToObject + FromObject,
Binding to nvim_win_call.
Calls a function with this window as the temporary current window.
sourcepub fn close(self, force: bool) -> Result<()>
pub fn close(self, force: bool) -> Result<()>
Binding to nvim_win_close.
Closes the window. Not allowed when
textlock is active.
sourcepub fn del_var(&mut self, name: &str) -> Result<()>
pub fn del_var(&mut self, name: &str) -> Result<()>
Binding to nvim_win_del_var.
Removes a window-scoped (w:) variable.
sourcepub fn get_buf(&self) -> Result<Buffer>
pub fn get_buf(&self) -> Result<Buffer>
Binding to nvim_win_get_buf.
Gets the current Buffer in the window.
sourcepub fn get_cursor(&self) -> Result<(usize, usize)>
pub fn get_cursor(&self) -> Result<(usize, usize)>
Binding to nvim_win_get_cursor.
Gets the (1,0)-indexed cursor position in the window.
sourcepub fn get_height(&self) -> Result<u32>
pub fn get_height(&self) -> Result<u32>
Binding to nvim_win_get_height.
Gets the window height as a count of rows.
sourcepub fn get_number(&self) -> Result<u32>
pub fn get_number(&self) -> Result<u32>
Binding to nvim_win_get_number.
Gets the window number.
sourcepub fn get_option<Opt>(&self, name: &str) -> Result<Opt> where
Opt: FromObject,
pub fn get_option<Opt>(&self, name: &str) -> Result<Opt> where
Opt: FromObject,
Binding to nvim_win_get_option.
Gets a window option value.
sourcepub fn get_position(&self) -> Result<(usize, usize)>
pub fn get_position(&self) -> Result<(usize, usize)>
Binding to nvim_win_get_position.
Gets the window position in display cells.
sourcepub fn get_tabpage(&self) -> Result<TabPage>
pub fn get_tabpage(&self) -> Result<TabPage>
Binding to nvim_win_get_tabpage.
Gets the window’s TabPage.
sourcepub fn get_var<Var>(&self, name: &str) -> Result<Var> where
Var: FromObject,
pub fn get_var<Var>(&self, name: &str) -> Result<Var> where
Var: FromObject,
Binding to nvim_win_get_var.
Gets a window-scoped (w:) variable.
sourcepub fn get_width(&self) -> Result<u32>
pub fn get_width(&self) -> Result<u32>
Binding to nvim_win_get_width.
Gets the window width as a number of columns.
sourcepub fn hide(self) -> Result<()>
pub fn hide(self) -> Result<()>
Binding to nvim_win_hide.
Closes the window and hides the buffer it contains.
sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Binding to nvim_win_is_valid.
Checks if the window is valid.
sourcepub fn set_buf(&mut self, buffer: &Buffer) -> Result<()>
pub fn set_buf(&mut self, buffer: &Buffer) -> Result<()>
Binding to nvim_win_set_buf.
Sets buffer as the current buffer in the window.
sourcepub fn set_cursor(&mut self, line: usize, col: usize) -> Result<()>
pub fn set_cursor(&mut self, line: usize, col: usize) -> Result<()>
Binding to nvim_win_set_cursor.
Sets the (1,0)-indexed cursor in the window. This will scroll the window even if it’s not the current one.
sourcepub fn set_height(&mut self, height: u32) -> Result<()>
pub fn set_height(&mut self, height: u32) -> Result<()>
Binding to nvim_win_set_height.
Sets the window height.
sourcepub fn set_option<Opt>(&mut self, name: &str, value: Opt) -> Result<()> where
Opt: ToObject,
pub fn set_option<Opt>(&mut self, name: &str, value: Opt) -> Result<()> where
Opt: ToObject,
Binding to nvim_win_set_option.
Sets a window option value. Passing None as value deletes the option
(only works if there’s a global fallback).
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Window
impl<'de> Deserialize<'de> for Window
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Window
impl StructuralEq for Window
impl StructuralPartialEq for Window
Auto Trait Implementations
impl RefUnwindSafe for Window
impl Send for Window
impl Sync for Window
impl Unpin for Window
impl UnwindSafe for Window
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