pub struct JsonDecodeOptions {
pub trim_whitespace: bool,
pub strip_utf8_bom: bool,
pub strip_markdown_code_fence: bool,
pub escape_control_chars_in_strings: bool,
}Expand description
Configuration switches for crate::LenientJsonDecoder.
Each flag controls one normalization rule applied before parsing JSON. Defaults are intentionally conservative and cover the most common non-fully-trusted text inputs without attempting aggressive repair.
Fields§
§trim_whitespace: boolControls whether leading and trailing whitespace is removed before any other normalization step is applied.
strip_utf8_bom: boolControls whether a leading UTF-8 byte order mark (U+FEFF) is removed
before parsing.
strip_markdown_code_fence: boolControls whether one outer Markdown code fence is removed.
Typical examples include json ... and bare fenced blocks
starting with ````` followed by a newline.
escape_control_chars_in_strings: boolControls whether raw ASCII control characters inside JSON string literals are converted into valid JSON escape sequences.
Trait Implementations§
Source§impl Clone for JsonDecodeOptions
impl Clone for JsonDecodeOptions
Source§fn clone(&self) -> JsonDecodeOptions
fn clone(&self) -> JsonDecodeOptions
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 JsonDecodeOptions
impl Debug for JsonDecodeOptions
Source§impl Default for JsonDecodeOptions
impl Default for JsonDecodeOptions
Source§impl PartialEq for JsonDecodeOptions
impl PartialEq for JsonDecodeOptions
impl Copy for JsonDecodeOptions
impl Eq for JsonDecodeOptions
impl StructuralPartialEq for JsonDecodeOptions
Auto Trait Implementations§
impl Freeze for JsonDecodeOptions
impl RefUnwindSafe for JsonDecodeOptions
impl Send for JsonDecodeOptions
impl Sync for JsonDecodeOptions
impl Unpin for JsonDecodeOptions
impl UnsafeUnpin for JsonDecodeOptions
impl UnwindSafe for JsonDecodeOptions
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