Skip to main content

ColoLogTrace

Trait ColoLogTrace 

Source
pub trait ColoLogTrace {
    // Required method
    fn log_data(&self) -> Vec<u8> ;

    // Provided methods
    fn log_index_length_color(&self) -> Option<Vec<(usize, usize, &'_ str)>> { ... }
    fn log_trace(&self) -> Result<bool, String> { ... }
}
Expand description

Implemented by types that can render themselves as a colorized hex dump via log_trace.

Required Methods§

Source

fn log_data(&self) -> Vec<u8>

Returns the raw bytes to be rendered as a hex dump.

Provided Methods§

Source

fn log_index_length_color(&self) -> Option<Vec<(usize, usize, &'_ str)>>

Returns optional (index, length, color) tuples describing colored byte ranges; defaults to None for an uncolored dump.

Source

fn log_trace(&self) -> Result<bool, String>

Renders the data (with any specified colors) as a hex dump and emits it via log_trace, falling back to an uncolored dump on failure.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§