[][src]Trait serde_json::ser::Formatter

pub trait Formatter {
    fn open<W>(&mut self, writer: &mut W, ch: u8) -> Result<()>
    where
        W: Write
;
fn comma<W>(&mut self, writer: &mut W, first: bool) -> Result<()>
    where
        W: Write
;
fn colon<W>(&mut self, writer: &mut W) -> Result<()>
    where
        W: Write
;
fn close<W>(&mut self, writer: &mut W, ch: u8) -> Result<()>
    where
        W: Write
; }

This trait abstracts away serializing the JSON control characters, which allows the user to optionally pretty print the JSON output.

Required Methods

Called when serializing a '{' or '['.

Called when serializing a ','.

Called when serializing a ':'.

Called when serializing a '}' or ']'.

Implementors

impl Formatter for CompactFormatter
[src]

impl<'a> Formatter for PrettyFormatter<'a>
[src]