pub struct PresetParser;Expand description
Parses, validates, and serializes TOML preset files.
Presets control every aspect of the compression pipeline — which stages run, how aggressive they are, token budget limits, model family, etc.
use sqz_engine::preset::PresetParser;
let toml = r#"
[preset]
name = "my-preset"
version = "1.0"
[compression]
stages = ["condense", "strip_nulls"]
[tool_selection]
max_tools = 5
similarity_threshold = 0.7
[budget]
warning_threshold = 0.70
ceiling_threshold = 0.85
default_window_size = 200000
[terse_mode]
enabled = false
level = "moderate"
[model]
family = "anthropic"
primary = "claude-sonnet-4-20250514"
complexity_threshold = 0.4
"#;
let preset = PresetParser::parse(toml).unwrap();
assert_eq!(preset.preset.name, "my-preset");Implementations§
Auto Trait Implementations§
impl Freeze for PresetParser
impl RefUnwindSafe for PresetParser
impl Send for PresetParser
impl Sync for PresetParser
impl Unpin for PresetParser
impl UnsafeUnpin for PresetParser
impl UnwindSafe for PresetParser
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