Expand description
Concrete implementations of the traits defined in crate::traits.
§What is implemented here
-
TerminalAccessonpar_term_terminal::TerminalManager— all five read-only query methods are direct thin wrappers over the existingTerminalManagermethods, so there is no behaviour change at call sites. -
UIElementoncrate::tab_bar_ui::TabBarUIandcrate::status_bar::StatusBarUI— each type defines its ownCtx<'a>holding the per-frame references it needs (config, tab count, fullscreen flag). Existing call sites are unaffected; the trait provides a new generic path.
§How to use TerminalAccess in new code
Any function that only needs to inspect terminal mode (e.g. mouse handlers,
input encoders) can be written against T: TerminalAccess instead of
taking a concrete &TerminalManager. This makes the function testable with
a lightweight mock:
use par_term::traits::TerminalAccess;
fn encode_if_tracking<T: TerminalAccess>(t: &T, button: u8, col: usize, row: usize) -> Vec<u8> {
if t.is_mouse_tracking_active() {
t.encode_mouse_event(button, col, row, true, 0)
} else {
Vec::new()
}
}See src/traits.rs for the full trait contract and migration path notes.
Structs§
- Status
BarCtx - Per-call context for
StatusBarUI. - TabBar
Ctx - Per-call context for
TabBarUI.