pub struct JsonOptions {
pub indent: Option<String>,
pub highlight: bool,
pub skip_keys: bool,
pub ensure_ascii: bool,
pub check_circular: bool,
pub allow_nan: bool,
pub sort_keys: bool,
}Expand description
The keyword arguments of rich.json.JSON, for Json::with_options.
skip_keys and check_circular are accepted for parity but cannot change
the output of a document parsed from a string: its keys are all strings
and it has no cycles. Upstream’s default= callable only applies to
JSON.from_data, which serializes arbitrary (non-JSON) objects.
Fields§
§indent: Option<String>indent=: the indent string, or None for a single line. An integer
indent n is n spaces (see JsonOptions::indent_spaces).
highlight: boolhighlight=: apply JSONHighlighter (default on).
skip_keys: boolskip_keys= (no effect on a parsed document).
ensure_ascii: boolensure_ascii=: escape every non-ASCII character (default off).
check_circular: boolcheck_circular= (no effect on a parsed document).
allow_nan: boolallow_nan=: with it off, NaN and the infinities are an error
(default on).
sort_keys: boolsort_keys=: sort object keys (default off).
Implementations§
Source§impl JsonOptions
impl JsonOptions
Sourcepub fn indent_spaces(indent: i64) -> Option<String>
pub fn indent_spaces(indent: i64) -> Option<String>
An integer indent=: n spaces, as json.dumps turns an int into
" " * n (so zero or a negative number puts each item on its own line
with no indentation).
Trait Implementations§
Source§impl Clone for JsonOptions
impl Clone for JsonOptions
Source§impl Debug for JsonOptions
impl Debug for JsonOptions
Source§impl Default for JsonOptions
impl Default for JsonOptions
impl Eq for JsonOptions
Source§impl PartialEq for JsonOptions
impl PartialEq for JsonOptions
impl StructuralPartialEq for JsonOptions
Auto Trait Implementations§
impl Freeze for JsonOptions
impl RefUnwindSafe for JsonOptions
impl Send for JsonOptions
impl Sync for JsonOptions
impl Unpin for JsonOptions
impl UnsafeUnpin for JsonOptions
impl UnwindSafe for JsonOptions
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
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
key and return true if they are equal.