pub trait Compressor: Send + Sync {
// Required methods
fn matches(&self, command: &str) -> bool;
fn compress(&self, command: &str, output: &str) -> String;
// Provided methods
fn specificity(&self) -> Specificity { ... }
fn matches_output(&self, _output: &str) -> bool { ... }
fn compress_output_match(&self, output: &str) -> String { ... }
}Expand description
A Compressor knows how to reduce one specific command’s output to fewer
tokens while preserving the information the agent needs.
Required Methods§
Provided Methods§
fn specificity(&self) -> Specificity
Sourcefn matches_output(&self, _output: &str) -> bool
fn matches_output(&self, _output: &str) -> bool
Returns true when this compressor recognizes output produced by its
inner tool even if the command head was a wrapper (npm test,
make test, ./scripts/check.sh, etc.). Wrapper compressors should
not override this; they remain command-only.
Sourcefn compress_output_match(&self, output: &str) -> String
fn compress_output_match(&self, output: &str) -> String
Compress output after an output-shape match. Compressors that branch by subcommand override this to jump directly to the matched branch.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".