Struct nvim_oxi_api::Window
source · pub struct Window(/* private fields */);Expand description
A wrapper around a Neovim window handle.
Implementations§
source§impl Window
impl Window
sourcepub fn get_option<Opt>(&self, name: &str) -> Result<Opt, Error>where
Opt: FromObject,
pub fn get_option<Opt>(&self, name: &str) -> Result<Opt, Error>where
Opt: FromObject,
Binding to nvim_win_get_option().
Gets a window option value.
sourcepub fn set_option<Opt>(&mut self, name: &str, value: Opt) -> Result<(), Error>where
Opt: ToObject,
pub fn set_option<Opt>(&mut self, name: &str, value: Opt) -> Result<(), Error>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).
source§impl Window
impl Window
sourcepub fn get_config(&self) -> Result<WindowConfig, Error>
pub fn get_config(&self) -> Result<WindowConfig, Error>
Binding to nvim_win_get_config().
Gets the window configuration.
sourcepub fn set_config(&mut self, config: &WindowConfig) -> Result<(), Error>
pub fn set_config(&mut self, config: &WindowConfig) -> Result<(), Error>
Binding to nvim_win_get_config().
Configures the window layout. Only for floating and external windows.
source§impl Window
impl Window
sourcepub fn current() -> Self
pub fn current() -> Self
Shorthand for get_current_win.
sourcepub fn call<F, Res, Ret>(&self, fun: F) -> Result<Ret, Error>where
F: FnOnce(()) -> Res + 'static,
Res: IntoResult<Ret>,
Res::Error: StdError + 'static,
Ret: Pushable + FromObject,
pub fn call<F, Res, Ret>(&self, fun: F) -> Result<Ret, Error>where
F: FnOnce(()) -> Res + 'static,
Res: IntoResult<Ret>,
Res::Error: StdError + 'static,
Ret: Pushable + FromObject,
Binding to nvim_win_call().
Calls a function with this window as the temporary current window.
sourcepub fn close(self, force: bool) -> Result<(), Error>
pub fn close(self, force: bool) -> Result<(), Error>
Binding to nvim_win_close().
Closes the window. Not allowed when
textlock is active.
sourcepub fn del_var(&mut self, name: &str) -> Result<(), Error>
pub fn del_var(&mut self, name: &str) -> Result<(), Error>
Binding to nvim_win_del_var().
Removes a window-scoped (w:) variable.
sourcepub fn get_buf(&self) -> Result<Buffer, Error>
pub fn get_buf(&self) -> Result<Buffer, Error>
Binding to nvim_win_get_buf().
Gets the current Buffer in the window.
sourcepub fn get_cursor(&self) -> Result<(usize, usize), Error>
pub fn get_cursor(&self) -> Result<(usize, usize), Error>
Binding to nvim_win_get_cursor().
Gets the (1,0)-indexed cursor position in the window.
sourcepub fn get_height(&self) -> Result<u32, Error>
pub fn get_height(&self) -> Result<u32, Error>
Binding to nvim_win_get_height().
Gets the window height as a count of rows.
sourcepub fn get_number(&self) -> Result<u32, Error>
pub fn get_number(&self) -> Result<u32, Error>
Binding to nvim_win_get_number().
Gets the window number.
sourcepub fn get_position(&self) -> Result<(usize, usize), Error>
pub fn get_position(&self) -> Result<(usize, usize), Error>
Binding to nvim_win_get_position().
Gets the window position in display cells.
sourcepub fn get_tabpage(&self) -> Result<TabPage, Error>
pub fn get_tabpage(&self) -> Result<TabPage, Error>
Binding to nvim_win_get_tabpage().
Gets the window’s TabPage.
sourcepub fn get_var<Var>(&self, name: &str) -> Result<Var, Error>where
Var: FromObject,
pub fn get_var<Var>(&self, name: &str) -> Result<Var, Error>where
Var: FromObject,
Binding to nvim_win_get_var().
Gets a window-scoped (w:) variable.
sourcepub fn get_width(&self) -> Result<u32, Error>
pub fn get_width(&self) -> Result<u32, Error>
Binding to nvim_win_get_width().
Gets the window width as a number of columns.
sourcepub fn hide(self) -> Result<(), Error>
pub fn hide(self) -> Result<(), Error>
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<(), Error>
pub fn set_buf(&mut self, buffer: &Buffer) -> Result<(), Error>
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<(), Error>
pub fn set_cursor(&mut self, line: usize, col: usize) -> Result<(), Error>
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<(), Error>
pub fn set_height(&mut self, height: u32) -> Result<(), Error>
Binding to nvim_win_set_height().
Sets the window height.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Window
impl<'de> Deserialize<'de> for Window
source§fn 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>,
source§impl FromObject for Window
impl FromObject for Window
source§impl PartialEq for Window
impl PartialEq for Window
impl Eq for Window
impl StructuralPartialEq for Window
Auto Trait Implementations§
impl Freeze for Window
impl RefUnwindSafe for Window
impl Send for Window
impl Sync for Window
impl Unpin for Window
impl UnwindSafe for Window
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
source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§type Error = Infallible
type Error = Infallible
Result.source§fn into_result(self) -> Result<T, <T as IntoResult<T>>::Error>
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Error>
Result.