Trait Decorator

Source
pub trait Decorator {
    // Required method
    fn with_record<F>(
        &self,
        _record: &Record<'_>,
        _logger_values: &OwnedKVList,
        f: F,
    ) -> Result<()>
       where F: FnOnce(&mut dyn RecordDecorator) -> Result<()>;
}
Expand description

Output decorator

Trait implementing strategy of output formating in terms of IO, colors, etc.

Required Methods§

Source

fn with_record<F>( &self, _record: &Record<'_>, _logger_values: &OwnedKVList, f: F, ) -> Result<()>
where F: FnOnce(&mut dyn RecordDecorator) -> Result<()>,

Get a RecordDecorator for a given record

This allows Decorator to have on-stack data per processed Records

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<T> Decorator for Box<T>
where T: Decorator + ?Sized,

Source§

fn with_record<F>( &self, record: &Record<'_>, logger_kv: &OwnedKVList, f: F, ) -> Result<()>
where F: FnOnce(&mut dyn RecordDecorator) -> Result<()>,

Implementors§