Skip to main content

TerminalStore

Trait TerminalStore 

Source
pub trait TerminalStore: Send + Sync {
    // Required methods
    fn install_synthetic(&self, id: BufferId) -> bool;
    fn clear_synthetic(&self, id: BufferId) -> bool;
}
Expand description

T-mode-1 (2026-05-27): service trait that TerminalNormalMode uses to build / drop the SyntheticDoc on a TerminalBuffer from its lifecycle hooks. The implementation lives on the host’s BufferRegistry; the mode pulls a handle to it via ModeContext::service::<TerminalStoreHandle>().

Two methods only: install (build + stash) and clear (drop). Keeping it minimal avoids leaking the with_terminal_mut closure surface across the crate boundary; the host wraps with_terminal_mut internally to satisfy these calls.

Required Methods§

Source

fn install_synthetic(&self, id: BufferId) -> bool

Build a SyntheticDoc from the terminal buffer’s current grid state and stash it on the buffer. Returns true if a terminal buffer existed for id (and the doc was installed); false otherwise. Idempotent — re-calling rebuilds the doc.

Source

fn clear_synthetic(&self, id: BufferId) -> bool

Drop any existing SyntheticDoc on the buffer. Idempotent. Returns true if a terminal buffer existed for id; false otherwise.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§