Trait Debuggable

Source
pub trait Debuggable {
Show 15 methods // Required method fn write_debug_for<WriteT>( &self, writer: &mut WriteT, context: &DebugContext<'_>, ) -> Result<()> where WriteT: Write; // Provided methods fn write_debug_with_format<WriteT>( &self, writer: &mut WriteT, format: DebugFormat, ) -> Result<()> where WriteT: Write { ... } fn write_debug<WriteT>(&self, writer: &mut WriteT) -> Result<()> where WriteT: Write { ... } fn write_debug_plain_with_format<WriteT>( &self, writer: &mut WriteT, format: DebugFormat, ) -> Result<()> where WriteT: Write { ... } fn write_debug_plain<WriteT>(&self, writer: &mut WriteT) -> Result<()> where WriteT: Write { ... } fn print_debug_with_format(&self, format: DebugFormat) { ... } fn print_debug(&self) { ... } fn print_debug_plain_with_format(&self, format: DebugFormat) { ... } fn print_debug_plain(&self) { ... } fn eprint_debug_with_format(&self, format: DebugFormat) { ... } fn eprint_debug(&self) { ... } fn eprint_debug_plain_with_format(&self, format: DebugFormat) { ... } fn eprint_debug_plain(&self) { ... } fn to_debug_string_with_format( &self, theme: &Theme, format: DebugFormat, ) -> Result<String> { ... } fn to_debug_string(&self, theme: &Theme) -> Result<String> { ... }
}
Expand description

Can write a debug representation of itself that can be indented, styled, and multiline.

Designed to support complex nested hierarchies.

Required Methods§

Source

fn write_debug_for<WriteT>( &self, writer: &mut WriteT, context: &DebugContext<'_>, ) -> Result<()>
where WriteT: Write,

Write the debug representation for the context.

Required behavior for implementations:

  1. Representations must not end in a newline.
  2. If not starting with a newline and not empty, must call DebugContext::separate first.
  3. All lines after the first (but not the first) must start with the DebugContext indentation.

Provided Methods§

Source

fn write_debug_with_format<WriteT>( &self, writer: &mut WriteT, format: DebugFormat, ) -> Result<()>
where WriteT: Write,

Write the debug representation with the default theme and a final newline.

Source

fn write_debug<WriteT>(&self, writer: &mut WriteT) -> Result<()>
where WriteT: Write,

Write the debug representation with the default theme and a final newline.

Source

fn write_debug_plain_with_format<WriteT>( &self, writer: &mut WriteT, format: DebugFormat, ) -> Result<()>
where WriteT: Write,

Write the debug representation with the plain theme and a final newline.

Source

fn write_debug_plain<WriteT>(&self, writer: &mut WriteT) -> Result<()>
where WriteT: Write,

Write the debug representation with the plain theme and a final newline.

Source

fn print_debug_with_format(&self, format: DebugFormat)

Print the debug representation to anstream::stdout with the default theme and a final newline.

Panics on write Error.

Source

fn print_debug(&self)

Print the debug representation to anstream::stdout with the default theme and a final newline.

Panics on write Error.

Source

fn print_debug_plain_with_format(&self, format: DebugFormat)

Print the debug representation to stdout with the plain theme and a final newline.

Panics on write Error.

Source

fn print_debug_plain(&self)

Print the debug representation to stdout with the plain theme and a final newline.

Panics on write Error.

Source

fn eprint_debug_with_format(&self, format: DebugFormat)

Print the debug representation to anstream::stderr with the default theme and a final newline.

Panics on write Error.

Source

fn eprint_debug(&self)

Print the debug representation to anstream::stderr with the default theme and a final newline.

Panics on write Error.

Source

fn eprint_debug_plain_with_format(&self, format: DebugFormat)

Print the debug representation to stderr with the plain theme and a final newline.

Panics on write Error.

Source

fn eprint_debug_plain(&self)

Print the debug representation to stderr with the plain theme and a final newline.

Panics on write Error.

Source

fn to_debug_string_with_format( &self, theme: &Theme, format: DebugFormat, ) -> Result<String>

Capture write_debug_for into a string.

Source

fn to_debug_string(&self, theme: &Theme) -> Result<String>

Capture write_debug_for into a string.

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.

Implementors§