pub struct ParseOptions {
pub max_input_bytes: usize,
pub max_nesting_depth: usize,
pub max_repair_attempts: usize,
pub strip_think_tags: bool,
pub allow_code_fences: bool,
}Expand description
Options controlling parser behavior and safety limits.
All public parse functions accept ParseOptions (via _with_trace variants)
to configure safety bounds and preprocessing behavior.
§Defaults
use llm_output_parser::ParseOptions;
let opts = ParseOptions::default();
assert_eq!(opts.max_input_bytes, 2_097_152);
assert_eq!(opts.max_nesting_depth, 64);
assert_eq!(opts.max_repair_attempts, 3);
assert!(opts.strip_think_tags);
assert!(opts.allow_code_fences);Fields§
§max_input_bytes: usizeMaximum input size in bytes. Inputs exceeding this return ParseError::TooLarge.
Default: 2,097,152 (2 MB).
max_nesting_depth: usizeMaximum JSON nesting depth tracked during bracket matching.
Inputs exceeding this return ParseError::TooDeep.
Default: 64.
max_repair_attempts: usizeMaximum number of JSON repair attempts before giving up. Default: 3.
Whether to strip <think> and <thinking> blocks during preprocessing.
Default: true.
allow_code_fences: boolWhether to attempt extraction from markdown code fences. Default: true.
Trait Implementations§
Source§impl Clone for ParseOptions
impl Clone for ParseOptions
Source§fn clone(&self) -> ParseOptions
fn clone(&self) -> ParseOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParseOptions
impl Debug for ParseOptions
Auto Trait Implementations§
impl Freeze for ParseOptions
impl RefUnwindSafe for ParseOptions
impl Send for ParseOptions
impl Sync for ParseOptions
impl Unpin for ParseOptions
impl UnsafeUnpin for ParseOptions
impl UnwindSafe for ParseOptions
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