Struct rustc_serialize::json::Encoder
[-] [+]
[src]
pub struct Encoder<'a> { // some fields omitted }
A structure for implementing serialization to JSON.
Methods
impl<'a> Encoder<'a>
fn new_pretty(writer: &'a mut Write) -> Encoder<'a>
Creates a new encoder whose output will be written in human-readable JSON to the specified writer
fn new(writer: &'a mut Write) -> Encoder<'a>
Creates a new encoder whose output will be written in compact JSON to the specified writer
fn set_indent(&mut self, new_indent: u32) -> Result<(), ()>
Set the number of spaces to indent for each level. This is safe to set during encoding.