Struct Serializer
pub struct Serializer<W, F = CompactFormatter> { /* private fields */ }
A structure for serializing Rust values into JSON.
Implementations
impl<'a, W> Serializer<W, PrettyFormatter<'a>>
where
W: Write,
fn pretty(writer: W) -> SelfCreates a new JSON pretty print serializer.
impl<W> Serializer<W>
where
W: Write,
fn new(writer: W) -> SelfCreates a new JSON serializer.
impl<W, F> Serializer<W, F>
where
W: Write,
F: Formatter,
fn with_formatter(writer: W, formatter: F) -> SelfCreates a new JSON visitor whose output will be written to the writer specified.
fn into_inner(self) -> WUnwrap the
Writerfrom theSerializer.