pub struct ParseOptionsBuilder { /* private fields */ }Expand description
Builder for ergonomic construction of ParseOptions.
Provides a fluent API for configuring parser options with sensible defaults.
§Examples
// Using builder with custom limits
let opts = ParseOptions::builder()
.max_depth(200)
.max_array_length(5000)
.strict(false)
.build();
// Using builder with defaults
let opts = ParseOptions::builder().build();Implementations§
Source§impl ParseOptionsBuilder
impl ParseOptionsBuilder
Sourcepub fn max_array_length(self, length: usize) -> Self
pub fn max_array_length(self, length: usize) -> Self
Sourcepub fn reference_mode(self, mode: ReferenceMode) -> Self
pub fn reference_mode(self, mode: ReferenceMode) -> Self
Sourcepub fn strict_refs(self) -> Self
pub fn strict_refs(self) -> Self
Enable strict reference resolution (error on unresolved).
Shorthand for .reference_mode(ReferenceMode::Strict).
§Examples
let opts = ParseOptions::builder()
.strict_refs()
.build();Sourcepub fn lenient_refs(self) -> Self
pub fn lenient_refs(self) -> Self
Enable lenient reference resolution (ignore unresolved).
Shorthand for .reference_mode(ReferenceMode::Lenient).
§Examples
let opts = ParseOptions::builder()
.lenient_refs()
.build();Sourcepub fn strict(self, strict: bool) -> Self
pub fn strict(self, strict: bool) -> Self
Set strict reference resolution mode (legacy compatibility).
Sourcepub fn max_file_size(self, size: usize) -> Self
pub fn max_file_size(self, size: usize) -> Self
Sourcepub fn max_line_length(self, length: usize) -> Self
pub fn max_line_length(self, length: usize) -> Self
Sourcepub fn max_aliases(self, count: usize) -> Self
pub fn max_aliases(self, count: usize) -> Self
Sourcepub fn max_columns(self, count: usize) -> Self
pub fn max_columns(self, count: usize) -> Self
Sourcepub fn max_nest_depth(self, depth: usize) -> Self
pub fn max_nest_depth(self, depth: usize) -> Self
Sourcepub fn max_block_string_size(self, size: usize) -> Self
pub fn max_block_string_size(self, size: usize) -> Self
Sourcepub fn max_object_keys(self, count: usize) -> Self
pub fn max_object_keys(self, count: usize) -> Self
Sourcepub fn max_total_keys(self, count: usize) -> Self
pub fn max_total_keys(self, count: usize) -> Self
Sourcepub fn build(self) -> ParseOptions
pub fn build(self) -> ParseOptions
Build the ParseOptions.
Trait Implementations§
Source§impl Clone for ParseOptionsBuilder
impl Clone for ParseOptionsBuilder
Source§fn clone(&self) -> ParseOptionsBuilder
fn clone(&self) -> ParseOptionsBuilder
Returns a duplicate of the value. Read more
1.0.0 · 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 ParseOptionsBuilder
impl Debug for ParseOptionsBuilder
Auto Trait Implementations§
impl Freeze for ParseOptionsBuilder
impl RefUnwindSafe for ParseOptionsBuilder
impl Send for ParseOptionsBuilder
impl Sync for ParseOptionsBuilder
impl Unpin for ParseOptionsBuilder
impl UnwindSafe for ParseOptionsBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more