pub struct FormatOptions {
pub indent_by: usize,
pub trailing_commas: bool,
pub collapse_containers_of_one: bool,
pub sort_array_items: bool,
pub options_by_path: HashMap<&'static str, HashSet<PathOption>>,
}
Expand description
Options that change the style of the formatted JSON5 output.
Fields§
§indent_by: usize
Indent the content of an object or array by this many spaces.
trailing_commas: bool
Add a trailing comma after the last element in an array or object.
collapse_containers_of_one: bool
If an array or object has only one item (or is empty), and no internal comments, collapse the array or object to a single line.
sort_array_items: bool
If true, sort array primitive values lexicographically. Be aware that the order may not matter in some use cases, but can be very important in others. Consider setting this option for specific property paths only, and otherwise use the default (false).
options_by_path: HashMap<&'static str, HashSet<PathOption>>
A set of “paths”, to identify elements of the JSON structure, mapped to a set of one or more PathOption settings.
Trait Implementations§
Source§impl Clone for FormatOptions
impl Clone for FormatOptions
Source§fn clone(&self) -> FormatOptions
fn clone(&self) -> FormatOptions
Returns a copy 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 FormatOptions
impl Debug for FormatOptions
Auto Trait Implementations§
impl Freeze for FormatOptions
impl RefUnwindSafe for FormatOptions
impl Send for FormatOptions
impl Sync for FormatOptions
impl Unpin for FormatOptions
impl UnwindSafe for FormatOptions
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)