pub struct BlinkState {
pub is_visible: bool,
pub last_input_time: Option<Instant>,
pub blink_timer_active: bool,
}Expand description
Cursor blink animation state.
Extracted from the old CursorManager so it can live independently
on TextEditManager without coupling to cursor position.
Fields§
§is_visible: boolWhether the cursor is currently visible (toggled by blink timer)
last_input_time: Option<Instant>Timestamp of the last user input event (keyboard, mouse click in text). Used to determine whether to blink or stay solid while typing.
blink_timer_active: boolWhether the cursor blink timer is currently active
Implementations§
Source§impl BlinkState
impl BlinkState
pub fn new() -> Self
Sourcepub fn reset_blink_on_input(&mut self, now: Instant)
pub fn reset_blink_on_input(&mut self, now: Instant)
Reset blink on user input — cursor stays solid until blink interval elapses.
Sourcepub fn toggle_visibility(&mut self) -> bool
pub fn toggle_visibility(&mut self) -> bool
Toggle cursor visibility (called by blink timer callback).
pub fn set_visibility(&mut self, visible: bool)
pub fn set_blink_timer_active(&mut self, active: bool)
pub fn is_blink_timer_active(&self) -> bool
Sourcepub fn should_blink(&self, now: &Instant) -> bool
pub fn should_blink(&self, now: &Instant) -> bool
Check if enough time has passed since last input to start blinking.
Trait Implementations§
Source§impl Clone for BlinkState
impl Clone for BlinkState
Source§fn clone(&self) -> BlinkState
fn clone(&self) -> BlinkState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 BlinkState
impl Debug for BlinkState
Auto Trait Implementations§
impl Freeze for BlinkState
impl RefUnwindSafe for BlinkState
impl Send for BlinkState
impl Sync for BlinkState
impl Unpin for BlinkState
impl UnsafeUnpin for BlinkState
impl UnwindSafe for BlinkState
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