pub struct DebugFreeze<A> {
pub enabled: bool,
pub pending_capture: bool,
pub snapshot: Option<Buffer>,
pub snapshot_text: String,
pub queued_actions: Vec<A>,
pub message: Option<String>,
pub overlay: Option<DebugOverlay>,
pub mouse_capture_enabled: bool,
}Expand description
Debug freeze state for capturing and inspecting UI frames
Generic over the action type A to store queued actions while frozen.
§Example
use tui_dispatch_core::debug::DebugFreeze;
// In your app state:
struct AppState {
debug: DebugFreeze<MyAction>,
// ... other fields
}
// Toggle freeze on F12:
fn handle_action(state: &mut AppState, action: MyAction) {
match action {
MyAction::ToggleDebug => {
state.debug.toggle();
}
other if state.debug.enabled => {
// Queue actions while frozen
state.debug.queue(other);
}
// ... normal handling
}
}Fields§
§enabled: boolWhether debug/freeze mode is enabled
pending_capture: boolFlag to capture the next frame
snapshot: Option<Buffer>The captured buffer snapshot
snapshot_text: StringPlain text version of snapshot (for clipboard)
queued_actions: Vec<A>Actions queued while frozen
message: Option<String>Feedback message to display
overlay: Option<DebugOverlay>Currently displayed overlay
mouse_capture_enabled: boolWhether mouse capture mode is enabled (for position inspection)
Implementations§
Source§impl<A> DebugFreeze<A>
impl<A> DebugFreeze<A>
Sourcepub fn toggle(&mut self)
pub fn toggle(&mut self)
Toggle freeze mode on/off
When enabling, sets pending_capture to capture the next frame. When disabling, clears the snapshot and queued actions.
Sourcepub fn request_capture(&mut self)
pub fn request_capture(&mut self)
Request a new capture on the next frame
Sourcepub fn take_queued(&mut self) -> Vec<A>
pub fn take_queued(&mut self) -> Vec<A>
Take all queued actions, leaving the queue empty
Sourcepub fn set_message(&mut self, msg: impl Into<String>)
pub fn set_message(&mut self, msg: impl Into<String>)
Set a feedback message
Sourcepub fn clear_message(&mut self)
pub fn clear_message(&mut self)
Clear the feedback message
Sourcepub fn set_overlay(&mut self, overlay: DebugOverlay)
pub fn set_overlay(&mut self, overlay: DebugOverlay)
Set the current overlay
Sourcepub fn clear_overlay(&mut self)
pub fn clear_overlay(&mut self)
Clear the current overlay
Sourcepub fn toggle_mouse_capture(&mut self)
pub fn toggle_mouse_capture(&mut self)
Toggle mouse capture mode
Trait Implementations§
Source§impl<A: Debug> Debug for DebugFreeze<A>
impl<A: Debug> Debug for DebugFreeze<A>
Auto Trait Implementations§
impl<A> Freeze for DebugFreeze<A>
impl<A> RefUnwindSafe for DebugFreeze<A>where
A: RefUnwindSafe,
impl<A> Send for DebugFreeze<A>where
A: Send,
impl<A> Sync for DebugFreeze<A>where
A: Sync,
impl<A> Unpin for DebugFreeze<A>where
A: Unpin,
impl<A> UnwindSafe for DebugFreeze<A>where
A: UnwindSafe,
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
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>
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>
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