Trait json_syntax::print::Print

source ·
pub trait Print {
    // Required method
    fn fmt_with(
        &self,
        f: &mut Formatter<'_>,
        options: &Options,
        indent: usize,
    ) -> Result;

    // Provided methods
    fn pretty_print(&self) -> Printed<'_, Self> { ... }
    fn compact_print(&self) -> Printed<'_, Self> { ... }
    fn inline_print(&self) -> Printed<'_, Self> { ... }
    fn print_with(&self, options: Options) -> Printed<'_, Self> { ... }
}
Expand description

Print methods.

Required Methods§

source

fn fmt_with( &self, f: &mut Formatter<'_>, options: &Options, indent: usize, ) -> Result

Provided Methods§

source

fn pretty_print(&self) -> Printed<'_, Self>

Print the value with Options::pretty options.

source

fn compact_print(&self) -> Printed<'_, Self>

Print the value with Options::compact options.

source

fn inline_print(&self) -> Printed<'_, Self>

Print the value with Options::inline options.

source

fn print_with(&self, options: Options) -> Printed<'_, Self>

Print the value with the given options.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Print for bool

source§

fn fmt_with( &self, f: &mut Formatter<'_>, _options: &Options, _indent: usize, ) -> Result

source§

impl<'a, T: Print + ?Sized> Print for &'a T

source§

fn fmt_with( &self, f: &mut Formatter<'_>, options: &Options, indent: usize, ) -> Result

source§

impl<T: Print> Print for Stripped<T>

source§

fn fmt_with( &self, f: &mut Formatter<'_>, options: &Options, indent: usize, ) -> Result

source§

impl<T: Print, M> Print for Meta<T, M>

source§

fn fmt_with( &self, f: &mut Formatter<'_>, options: &Options, indent: usize, ) -> Result

Implementors§