Struct json::encoder::Encoder
[−]
[src]
pub struct Encoder<W> { /* fields omitted */ }
JSON encoder over any Write
-type.
Methods
impl<W: Write> Encoder<W>
[src]
fn new(w: W) -> Encoder<W>
fn into_writer(self) -> W
fn writer_mut(&mut self) -> &mut W
fn to_json<T: ToJson>(&mut self, t: T) -> EncodeResult<()>
fn encode(&mut self, j: &Json) -> EncodeResult<()>
fn u8(&mut self, x: u8) -> EncodeResult<()>
fn u16(&mut self, x: u16) -> EncodeResult<()>
fn u32(&mut self, x: u32) -> EncodeResult<()>
fn u64(&mut self, x: u64) -> EncodeResult<()>
fn usize(&mut self, x: usize) -> EncodeResult<()>
fn i8(&mut self, x: i8) -> EncodeResult<()>
fn i16(&mut self, x: i16) -> EncodeResult<()>
fn i32(&mut self, x: i32) -> EncodeResult<()>
fn i64(&mut self, x: i64) -> EncodeResult<()>
fn isize(&mut self, x: isize) -> EncodeResult<()>
fn f64(&mut self, x: f64) -> EncodeResult<()>
fn bool(&mut self, x: bool) -> EncodeResult<()>
fn null(&mut self) -> EncodeResult<()>
fn optional<T: ToJson>(&mut self, val: Option<T>) -> EncodeResult<()>
fn string<S: Borrow<str>>(&mut self, s: S) -> EncodeResult<()>
fn key<S: Borrow<str>>(&mut self, key: S) -> EncodeResult<()>
fn array(&mut self) -> EncodeResult<()>
Begin encoding a new JSON array.
Must be paired with a call to Encoder::end()
.
fn object(&mut self) -> EncodeResult<()>
Begin encoding a new JSON object.
Must be paired with a call to Encoder::end()
.
fn end(&mut self) -> EncodeResult<()>
End a JSON array or object.