Skip to main content

JsonPrint

Trait JsonPrint 

Source
pub trait JsonPrint {
    // Required method
    fn fmt_with(
        &self,
        f: &mut Formatter<'_>,
        options: &JsonPrintOptions,
        indent: usize,
    ) -> Result;

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

Print methods.

Required Methods§

Source

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

Provided Methods§

Source

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

Print the value with Options::pretty options.

Source

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

Print the value with Options::compact options.

Source

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

Print the value with Options::inline options.

Source

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

Print the value with the given options.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§