pub struct Snapshot<'alloc, 's>(/* private fields */);Expand description
A snapshot of the render state after an update.
This struct exists to guard data accessed from the render state from being accidentally modified after an update. If you find yourself unable to update the render state due to borrow checker errors, make sure to drop the active snapshot (and data that depends on it) before updating.
Implementations§
Source§impl Snapshot<'_, '_>
impl Snapshot<'_, '_>
Sourcepub fn cursor_color(&self) -> Result<Option<RgbColor>>
pub fn cursor_color(&self) -> Result<Option<RgbColor>>
Get the cursor color that may have been explicitly set by the terminal state.
Sourcepub fn cursor_visible(&self) -> Result<bool>
pub fn cursor_visible(&self) -> Result<bool>
Whether the cursor is currently visible based on terminal modes.
Sourcepub fn cursor_blinking(&self) -> Result<bool>
pub fn cursor_blinking(&self) -> Result<bool>
Whether the cursor is currently blinking based on terminal modes.
Sourcepub fn cursor_password_input(&self) -> Result<bool>
pub fn cursor_password_input(&self) -> Result<bool>
Whether the cursor is at a password input field.
Sourcepub fn cursor_visual_style(&self) -> Result<CursorVisualStyle>
pub fn cursor_visual_style(&self) -> Result<CursorVisualStyle>
Get the visual style of the cursor.
Sourcepub fn cursor_viewport(&self) -> Result<Option<CursorViewport>>
pub fn cursor_viewport(&self) -> Result<Option<CursorViewport>>
Get the relative position of the cursor and other information if it is currently visible within the viewport.
Trait Implementations§
Auto Trait Implementations§
impl<'alloc, 's> Freeze for Snapshot<'alloc, 's>
impl<'alloc, 's> RefUnwindSafe for Snapshot<'alloc, 's>
impl<'alloc, 's> !Send for Snapshot<'alloc, 's>
impl<'alloc, 's> !Sync for Snapshot<'alloc, 's>
impl<'alloc, 's> Unpin for Snapshot<'alloc, 's>
impl<'alloc, 's> UnsafeUnpin for Snapshot<'alloc, 's>
impl<'alloc, 's> !UnwindSafe for Snapshot<'alloc, 's>
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
Mutably borrows from an owned value. Read more