pub struct JsonView { /* private fields */ }Expand description
Widget that renders pretty-printed JSON with syntax coloring.
Implementations§
Source§impl JsonView
impl JsonView
Sourcepub fn with_indent(self, indent: usize) -> Self
pub fn with_indent(self, indent: usize) -> Self
Set the indentation width.
Sourcepub fn with_key_style(self, style: Style) -> Self
pub fn with_key_style(self, style: Style) -> Self
Set style for object keys.
Sourcepub fn with_string_style(self, style: Style) -> Self
pub fn with_string_style(self, style: Style) -> Self
Set style for string values.
Sourcepub fn with_number_style(self, style: Style) -> Self
pub fn with_number_style(self, style: Style) -> Self
Set style for numbers.
Sourcepub fn with_literal_style(self, style: Style) -> Self
pub fn with_literal_style(self, style: Style) -> Self
Set style for boolean/null literals.
Sourcepub fn with_punct_style(self, style: Style) -> Self
pub fn with_punct_style(self, style: Style) -> Self
Set style for punctuation.
Sourcepub fn with_error_style(self, style: Style) -> Self
pub fn with_error_style(self, style: Style) -> Self
Set style for error text.
Sourcepub fn set_source(&mut self, source: impl Into<String>)
pub fn set_source(&mut self, source: impl Into<String>)
Set the source JSON.
Sourcepub fn formatted_lines(&self) -> Vec<Vec<JsonToken>>
pub fn formatted_lines(&self) -> Vec<Vec<JsonToken>>
Pretty-format the JSON into lines of tokens for rendering.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JsonView
impl RefUnwindSafe for JsonView
impl Send for JsonView
impl Sync for JsonView
impl Unpin for JsonView
impl UnsafeUnpin for JsonView
impl UnwindSafe for JsonView
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