Struct PrettyFormatter

struct PrettyFormatter<'a> { ... }

This structure pretty prints a JSON value to make it human readable.

Implementations

impl<'a> PrettyFormatter<'a>

fn new() -> Self

Construct a pretty printer formatter that defaults to using two spaces for indentation.

fn with_indent(indent: &'a [u8]) -> Self

Construct a pretty printer formatter that uses the indent string for indentation.

impl<'a> Clone for PrettyFormatter<'a>

fn clone(self: &Self) -> PrettyFormatter<'a>

impl<'a> Debug for PrettyFormatter<'a>

fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result

impl<'a> Default for PrettyFormatter<'a>

fn default() -> Self

impl<'a> Formatter for PrettyFormatter<'a>

fn begin_array<W>(self: &mut Self, writer: &mut W) -> io::Result<()>
where
    W: ?Sized + io::Write
fn end_array<W>(self: &mut Self, writer: &mut W) -> io::Result<()>
where
    W: ?Sized + io::Write
fn begin_array_value<W>(self: &mut Self, writer: &mut W, first: bool) -> io::Result<()>
where
    W: ?Sized + io::Write
fn end_array_value<W>(self: &mut Self, _writer: &mut W) -> io::Result<()>
where
    W: ?Sized + io::Write
fn begin_object<W>(self: &mut Self, writer: &mut W) -> io::Result<()>
where
    W: ?Sized + io::Write
fn end_object<W>(self: &mut Self, writer: &mut W) -> io::Result<()>
where
    W: ?Sized + io::Write
fn begin_object_key<W>(self: &mut Self, writer: &mut W, first: bool) -> io::Result<()>
where
    W: ?Sized + io::Write
fn begin_object_value<W>(self: &mut Self, writer: &mut W) -> io::Result<()>
where
    W: ?Sized + io::Write
fn end_object_value<W>(self: &mut Self, _writer: &mut W) -> io::Result<()>
where
    W: ?Sized + io::Write

impl<'a> Freeze for PrettyFormatter<'a>

impl<'a> RefUnwindSafe for PrettyFormatter<'a>

impl<'a> Send for PrettyFormatter<'a>

impl<'a> Sync for PrettyFormatter<'a>

impl<'a> Unpin for PrettyFormatter<'a>

impl<'a> UnwindSafe for PrettyFormatter<'a>

impl<T> Any for PrettyFormatter<'a>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for PrettyFormatter<'a>

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

impl<T> BorrowMut for PrettyFormatter<'a>

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

impl<T> CloneToUninit for PrettyFormatter<'a>

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for PrettyFormatter<'a>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for PrettyFormatter<'a>

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for PrettyFormatter<'a>

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 PrettyFormatter<'a>

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

impl<T, U> TryInto for PrettyFormatter<'a>

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