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

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

This trait abstracts away serializing the JSON control characters

Required methods

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

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

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

Called when serializing a ','.

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

Called when serializing a ':'.

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

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

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

Newline with indent.

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

Start a value.

Loading content...

Implementors

Loading content...