Trait slog::KV [] [src]

pub trait KV {
    fn serialize(&self, record: &Record, serializer: &mut Serializer) -> Result;
}

Key-value pair(s)

Zero, one or more key value pairs chained together

Any logging data must implement this trait for slog to be able to use it.

Types implementing this trait can emit multiple key-value pairs. The order of emitting them should be consistent with the way key-value pair hierarchy is traversed: from data most specific to the logging context to the most general one. Or in other words: from newest to oldest.

Required Methods

Serialize self into Serializer

KV should call respective Serializer methods for each key-value pair it contains.

Implementors