Struct serde_json::ser::PrettyFormatter
[−]
[src]
pub struct PrettyFormatter<'a> { /* fields omitted */ }
This structure pretty prints a JSON value to make it human readable.
Methods
impl<'a> PrettyFormatter<'a>
[src]
fn new() -> Self
Construct a pretty printer formatter that defaults to using two spaces for indentation.
fn with_indent(indent: &'a [u8]) -> Self
Construct a pretty printer formatter that uses the indent
string for indentation.
Trait Implementations
impl<'a> Clone for PrettyFormatter<'a>
[src]
fn clone(&self) -> PrettyFormatter<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<'a> Debug for PrettyFormatter<'a>
[src]
impl<'a> Default for PrettyFormatter<'a>
[src]
impl<'a> Formatter for PrettyFormatter<'a>
[src]
fn open<W>(&mut self, writer: &mut W, ch: u8) -> Result<()> where W: Write
Called when serializing a '{' or '['.
fn comma<W>(&mut self, writer: &mut W, first: bool) -> Result<()> where W: Write
Called when serializing a ','.
fn colon<W>(&mut self, writer: &mut W) -> Result<()> where W: Write
Called when serializing a ':'.
fn close<W>(&mut self, writer: &mut W, ch: u8) -> Result<()> where W: Write
Called when serializing a '}' or ']'.