pub enum ExitState {
Normal,
AwaitingConfirmation {
since: Instant,
timeout_secs: u64,
},
}Expand description
Exit confirmation state for key handlers.
This tracks whether the user has initiated an exit sequence that requires confirmation (e.g., press Ctrl+D twice to quit).
Variants§
Normal
Normal operation, no exit pending.
AwaitingConfirmation
Awaiting exit confirmation within the timeout.
Implementations§
Source§impl ExitState
impl ExitState
Sourcepub fn awaiting_confirmation(timeout_secs: u64) -> Self
pub fn awaiting_confirmation(timeout_secs: u64) -> Self
Create a new exit confirmation state.
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if the confirmation has expired.
Sourcepub fn is_awaiting(&self) -> bool
pub fn is_awaiting(&self) -> bool
Check if awaiting confirmation (and not expired).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExitState
impl RefUnwindSafe for ExitState
impl Send for ExitState
impl Sync for ExitState
impl Unpin for ExitState
impl UnwindSafe for ExitState
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> 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