pub struct MousePointerState {
pub enabled: bool,
pub position: Option<(u16, u16)>,
}Expand description
State for the mouse pointer indicator.
Tracks whether the pointer is enabled and its current position.
Fields§
§enabled: boolWhether the pointer indicator is visible.
position: Option<(u16, u16)>Current mouse position (column, row). None if not yet set.
Implementations§
Source§impl MousePointerState
impl MousePointerState
Sourcepub fn with_enabled(enabled: bool) -> Self
pub fn with_enabled(enabled: bool) -> Self
Create a new mouse pointer state with enabled status.
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Set whether the pointer indicator is enabled.
Sourcepub fn update_position(&mut self, col: u16, row: u16)
pub fn update_position(&mut self, col: u16, row: u16)
Update the mouse position.
Sourcepub fn clear_position(&mut self)
pub fn clear_position(&mut self)
Clear the stored position.
Sourcepub fn should_render(&self) -> bool
pub fn should_render(&self) -> bool
Check if the pointer should be rendered.
Returns true if enabled and position is set.
Trait Implementations§
Source§impl Clone for MousePointerState
impl Clone for MousePointerState
Source§fn clone(&self) -> MousePointerState
fn clone(&self) -> MousePointerState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MousePointerState
impl Debug for MousePointerState
Source§impl Default for MousePointerState
impl Default for MousePointerState
Source§fn default() -> MousePointerState
fn default() -> MousePointerState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MousePointerState
impl RefUnwindSafe for MousePointerState
impl Send for MousePointerState
impl Sync for MousePointerState
impl Unpin for MousePointerState
impl UnwindSafe for MousePointerState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more