pub struct KeyHandler { /* private fields */ }Expand description
Interactive key handler for watch mode.
Implementations§
Source§impl KeyHandler
impl KeyHandler
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Create the key handler. Does NOT enable raw mode — the watch loop controls that.
§Errors
Returns an error if the terminal doesn’t support raw mode (non-TTY).
Sourcepub async fn recv(&self) -> Option<WatchCommand>
pub async fn recv(&self) -> Option<WatchCommand>
Receive the next key command (async).
Sourcepub fn enter_interactive(&self)
pub fn enter_interactive(&self)
Enter interactive mode: enable raw mode and start accepting keypresses. Call after test run completes, before the idle wait.
Sourcepub fn leave_interactive(&self)
pub fn leave_interactive(&self)
Leave interactive mode: disable raw mode so output renders correctly. Call before running tests.
Trait Implementations§
Source§impl Drop for KeyHandler
impl Drop for KeyHandler
Auto Trait Implementations§
impl Freeze for KeyHandler
impl !RefUnwindSafe for KeyHandler
impl Send for KeyHandler
impl Sync for KeyHandler
impl !Unpin for KeyHandler
impl !UnsafeUnpin for KeyHandler
impl !UnwindSafe for KeyHandler
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