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§
Sourcefn write_debug_for<WriteT>(
&self,
writer: &mut WriteT,
context: &DebugContext<'_>,
) -> Result<()>where
WriteT: Write,
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:
- Representations must not end in a newline.
- If not starting with a newline and not empty, must call DebugContext::separate first.
- All lines after the first (but not the first) must start with the DebugContext indentation.
Provided Methods§
Sourcefn write_debug_with_format<WriteT>(
&self,
writer: &mut WriteT,
format: DebugFormat,
) -> Result<()>where
WriteT: Write,
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.
Sourcefn write_debug<WriteT>(&self, writer: &mut WriteT) -> Result<()>where
WriteT: Write,
fn write_debug<WriteT>(&self, writer: &mut WriteT) -> Result<()>where
WriteT: Write,
Write the debug representation with the default theme and a final newline.
Sourcefn write_debug_plain_with_format<WriteT>(
&self,
writer: &mut WriteT,
format: DebugFormat,
) -> Result<()>where
WriteT: Write,
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.
Sourcefn write_debug_plain<WriteT>(&self, writer: &mut WriteT) -> Result<()>where
WriteT: Write,
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.
Sourcefn print_debug_with_format(&self, format: DebugFormat)
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.
Sourcefn print_debug(&self)
fn print_debug(&self)
Print the debug representation to anstream::stdout with the default theme and a final newline.
Panics on write Error.
Sourcefn print_debug_plain_with_format(&self, format: DebugFormat)
fn print_debug_plain_with_format(&self, format: DebugFormat)
Sourcefn print_debug_plain(&self)
fn print_debug_plain(&self)
Sourcefn eprint_debug_with_format(&self, format: DebugFormat)
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.
Sourcefn eprint_debug(&self)
fn eprint_debug(&self)
Print the debug representation to anstream::stderr with the default theme and a final newline.
Panics on write Error.
Sourcefn eprint_debug_plain_with_format(&self, format: DebugFormat)
fn eprint_debug_plain_with_format(&self, format: DebugFormat)
Sourcefn eprint_debug_plain(&self)
fn eprint_debug_plain(&self)
Sourcefn to_debug_string_with_format(
&self,
theme: &Theme,
format: DebugFormat,
) -> Result<String>
fn to_debug_string_with_format( &self, theme: &Theme, format: DebugFormat, ) -> Result<String>
Capture write_debug_representation into a string.
Sourcefn to_debug_string(&self, theme: &Theme) -> Result<String>
fn to_debug_string(&self, theme: &Theme) -> Result<String>
Capture write_debug_representation 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.