pub struct EncodeOptions {
pub delimiter: Delimiter,
pub indent: Indent,
pub key_folding: KeyFoldingMode,
pub flatten_depth: usize,
}Expand description
Options for encoding JSON values to TOON format.
Fields§
§delimiter: Delimiter§indent: Indent§key_folding: KeyFoldingMode§flatten_depth: usizeImplementations§
Source§impl EncodeOptions
impl EncodeOptions
Sourcepub fn with_delimiter(self, delimiter: Delimiter) -> Self
pub fn with_delimiter(self, delimiter: Delimiter) -> Self
Set the delimiter for array elements.
Sourcepub fn with_indent(self, style: Indent) -> Self
pub fn with_indent(self, style: Indent) -> Self
Set the indentation string for nested structures.
Sourcepub fn with_spaces(self, count: usize) -> Self
pub fn with_spaces(self, count: usize) -> Self
Set indentation to a specific number of spaces.
Sourcepub fn with_key_folding(self, mode: KeyFoldingMode) -> Self
pub fn with_key_folding(self, mode: KeyFoldingMode) -> Self
Enable key folding (v1.5 feature).
When set to Safe, single-key object chains will be folded into
dotted-path notation if all safety requirements are met.
Default: Off
Sourcepub fn with_flatten_depth(self, depth: usize) -> Self
pub fn with_flatten_depth(self, depth: usize) -> Self
Set maximum depth for key folding.
Controls how many segments will be folded. A value of 2 folds
only two-segment chains: {a: {b: val}} → a.b: val.
Default: usize::MAX (fold entire eligible chains)
Trait Implementations§
Source§impl Clone for EncodeOptions
impl Clone for EncodeOptions
Source§fn clone(&self) -> EncodeOptions
fn clone(&self) -> EncodeOptions
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 EncodeOptions
impl Debug for EncodeOptions
Source§impl Default for EncodeOptions
impl Default for EncodeOptions
Source§impl PartialEq for EncodeOptions
impl PartialEq for EncodeOptions
impl Eq for EncodeOptions
impl StructuralPartialEq for EncodeOptions
Auto Trait Implementations§
impl Freeze for EncodeOptions
impl RefUnwindSafe for EncodeOptions
impl Send for EncodeOptions
impl Sync for EncodeOptions
impl Unpin for EncodeOptions
impl UnwindSafe for EncodeOptions
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.