pub struct DebouncedInput { /* private fields */ }
Expand description
A reusable debounced input widget
Implementations§
Source§impl DebouncedInput
impl DebouncedInput
Sourcepub fn with_config(config: DebouncedInputConfig) -> Self
pub fn with_config(config: DebouncedInputConfig) -> Self
Create a new debounced input with custom config
Sourcepub fn deactivate(&mut self)
pub fn deactivate(&mut self)
Deactivate the input widget
Sourcepub fn set_config(&mut self, config: DebouncedInputConfig)
pub fn set_config(&mut self, config: DebouncedInputConfig)
Update configuration
Sourcepub fn handle_key(&mut self, key: KeyEvent) -> DebouncedInputAction
pub fn handle_key(&mut self, key: KeyEvent) -> DebouncedInputAction
Handle a key event
Sourcepub fn check_debounce(&mut self) -> Option<String>
pub fn check_debounce(&mut self) -> Option<String>
Check if the debounced action should execute This should be called periodically (e.g., in the main event loop)
Auto Trait Implementations§
impl Freeze for DebouncedInput
impl RefUnwindSafe for DebouncedInput
impl Send for DebouncedInput
impl Sync for DebouncedInput
impl Unpin for DebouncedInput
impl UnwindSafe for DebouncedInput
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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