pub trait Decorator:
Send
+ Sync
+ Sized {
type RecordDecorator: RecordDecorator;
// Required method
fn decorate(&self, record: &Record<'_>) -> Self::RecordDecorator;
}Expand description
Formatted stream decorator
Some Formats for which it make sense can use this to parametrize
themselves on the exact behavior of formatting parts of the output. This
can be used eg. to use color when displaying logger records on the terminal.
Required Associated Types§
Sourcetype RecordDecorator: RecordDecorator
type RecordDecorator: RecordDecorator
Per-record decorator
Required Methods§
Sourcefn decorate(&self, record: &Record<'_>) -> Self::RecordDecorator
fn decorate(&self, record: &Record<'_>) -> Self::RecordDecorator
Get a RecordDecorator for a given record
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.