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>

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", so this trait is not object safe.

Implementations on Foreign Types§

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 Context

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 Type

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 Print for Vocab

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 NumberBuf<SmallVec<[u8; 16]>>

Source§

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

Source§

impl Print for SmallString<[u8; 16]>

Source§

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

Source§

impl<'a> Print for EntryKeyRef<'a>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§