pub struct PaneInteractionGuard<'a> { /* private fields */ }Expand description
RAII guard that ensures pane interaction state is cleanly canceled on drop.
When a pane interaction session is active and the guard drops (due to panic, scope exit, or any other unwind), it force-cancels any in-progress drag/resize and collects cleanup diagnostics.
§Usage
ⓘ
let guard = PaneInteractionGuard::new(&mut adapter);
// ... pane interaction event loop ...
// If this scope panics, guard's Drop will force-cancel the drag machine
let diagnostics = guard.finish(); // explicit clean finishImplementations§
Source§impl<'a> PaneInteractionGuard<'a>
impl<'a> PaneInteractionGuard<'a>
Sourcepub fn new(adapter: &'a mut PaneTerminalAdapter) -> Self
pub fn new(adapter: &'a mut PaneTerminalAdapter) -> Self
Create a new guard wrapping the given adapter.
Sourcepub fn adapter(&mut self) -> &mut PaneTerminalAdapter
pub fn adapter(&mut self) -> &mut PaneTerminalAdapter
Access the wrapped adapter for normal event translation.
Sourcepub fn finish(self) -> Option<PaneCleanupDiagnostics>
pub fn finish(self) -> Option<PaneCleanupDiagnostics>
Explicitly finish the guard, returning any cleanup diagnostics.
Calling finish() is optional — the guard will also clean up on drop.
However, finish() gives the caller access to the diagnostics.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for PaneInteractionGuard<'a>
impl<'a> RefUnwindSafe for PaneInteractionGuard<'a>
impl<'a> Send for PaneInteractionGuard<'a>
impl<'a> Sync for PaneInteractionGuard<'a>
impl<'a> Unpin for PaneInteractionGuard<'a>
impl<'a> UnsafeUnpin for PaneInteractionGuard<'a>
impl<'a> !UnwindSafe for PaneInteractionGuard<'a>
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