Skip to main content

Print

Trait Print 

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

    // 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<(), Error>

Writes the value to f with the given options, starting at the given indentation level.

§Errors

Returns fmt::Error if writing to the formatter fails.

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.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Print for CompactString

Source§

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

Source§

impl Print for Context

Source§

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

Source§

impl Print for EntryKeyRef<'_>

Source§

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

Source§

impl Print for Id

Source§

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

Source§

impl Print for Index

Source§

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

Source§

impl Print for Simple

Source§

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

Source§

impl Print for Type

Source§

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

Source§

impl Print for TypeContainer

Source§

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

Source§

impl Print for Version

Source§

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

Source§

impl Print for Vocab

Source§

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

Source§

impl Print for bool

Source§

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

Source§

impl<T, C> Print for Contextual<T, &C>
where T: PrintWithContext<C>,

Source§

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

Source§

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

Source§

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

Implementors§