Trait nu_json::ser::Formatter[][src]

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
;
fn newline<W>(&mut self, writer: &mut W, add_indent: i32) -> Result<()>
    where
        W: Write
;
fn start_value<W>(&mut self, writer: &mut W) -> Result<()>
    where
        W: Write
; }
Expand description

This trait abstracts away serializing the JSON control characters

Required methods

fn open<W>(&mut self, writer: &mut W, ch: u8) -> Result<()> where
    W: Write
[src]

Expand description

Called when serializing a ‘{’ or ‘[’.

fn comma<W>(&mut self, writer: &mut W, first: bool) -> Result<()> where
    W: Write
[src]

Expand description

Called when serializing a ‘,’.

fn colon<W>(&mut self, writer: &mut W) -> Result<()> where
    W: Write
[src]

Expand description

Called when serializing a ‘:’.

fn close<W>(&mut self, writer: &mut W, ch: u8) -> Result<()> where
    W: Write
[src]

Expand description

Called when serializing a ‘}’ or ‘]’.

fn newline<W>(&mut self, writer: &mut W, add_indent: i32) -> Result<()> where
    W: Write
[src]

Expand description

Newline with indent.

fn start_value<W>(&mut self, writer: &mut W) -> Result<()> where
    W: Write
[src]

Expand description

Start a value.

Loading content...

Implementors

Loading content...