[][src]Struct rustc_serialize::json::Encoder

pub struct Encoder<'a> { /* fields omitted */ }

A structure for implementing serialization to JSON.

Implementations

impl<'a> Encoder<'a>[src]

pub fn new_pretty(writer: &'a mut dyn Write) -> Encoder<'a>[src]

Creates a new encoder whose output will be written in human-readable JSON to the specified writer

pub fn new(writer: &'a mut dyn Write) -> Encoder<'a>[src]

Creates a new encoder whose output will be written in compact JSON to the specified writer

pub fn set_indent(&mut self, new_indent: u32) -> Result<(), ()>[src]

Set the number of spaces to indent for each level. This is safe to set during encoding.

Trait Implementations

impl<'a> Encoder for Encoder<'a>[src]

type Error = EncoderError

The error type for method results.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Encoder<'a>

impl<'a> !Send for Encoder<'a>

impl<'a> !Sync for Encoder<'a>

impl<'a> Unpin for Encoder<'a>

impl<'a> !UnwindSafe for Encoder<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.