pub trait CompressionPattern: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn matches(&self, command: &str) -> bool;
fn compress(&self, command: &str, output: &str) -> Option<String>;
fn prefixes(&self) -> &[&str];
// Provided method
fn version(&self) -> u32 { ... }
}Expand description
Plugin-ready trait for shell output compression patterns.
Each pattern matches a specific CLI tool (or family of tools) and compresses its output into a token-efficient representation.
Existing patterns implement this via the blanket compress(cmd, output)
functions. Future plugins will register implementations dynamically.
Required Methods§
Sourcefn matches(&self, command: &str) -> bool
fn matches(&self, command: &str) -> bool
Returns true if this pattern can handle the given command. Called during dispatch to find the appropriate pattern.