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
fn serialize(&self, record: &Record, serializer: &mut Serializer) -> Result
Serialize self into Serializer
KV
should call respective Serializer
methods
for each key-value pair it contains.
Implementors
impl<'a, T> KV for &'a T where
T: KV,impl<V> KV for SingleKV<V> where
V: Value,impl KV for ()
impl<T: KV, R: KV> KV for (T, R)
impl<T: ?Sized> KV for Box<T> where
T: KV,impl<T: ?Sized> KV for Arc<T> where
T: KV,impl<T: ?Sized> KV for OwnedKV<T> where
T: SendSyncRefUnwindSafeKV,impl<'a> KV for BorrowedKV<'a>
impl KV for OwnedKVList