Struct Serializer

struct Serializer<W, F = CompactFormatter> { ... }

A structure for serializing Rust values into JSON.

Implementations

impl<'a, W> Serializer<W, PrettyFormatter<'a>>

fn pretty(writer: W) -> Self

Creates a new JSON pretty print serializer.

impl<W> Serializer<W>

fn new(writer: W) -> Self

Creates a new JSON serializer.

impl<W, F> Serializer<W, F>

fn with_formatter(writer: W, formatter: F) -> Self

Creates a new JSON visitor whose output will be written to the writer specified.

fn into_inner(self: Self) -> W

Unwrap the Writer from the Serializer.

impl<T> Any for Serializer<W, F>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Serializer<W, F>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Serializer<W, F>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for Serializer<W, F>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for Serializer<W, F>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Serializer<W, F>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Serializer<W, F>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>

impl<W, F> Freeze for Serializer<W, F>

impl<W, F> RefUnwindSafe for Serializer<W, F>

impl<W, F> Send for Serializer<W, F>

impl<W, F> Sync for Serializer<W, F>

impl<W, F> Unpin for Serializer<W, F>

impl<W, F> UnwindSafe for Serializer<W, F>