Struct slog::OwnedKeyValueList
[−]
[src]
pub struct OwnedKeyValueList { /* fields omitted */ }
Chain of SyncMultiSerialize
-s of a Logger
and its ancestors
Methods
impl OwnedKeyValueList
[src]
fn new(values: Box<SyncMultiSerialize>, parent: OwnedKeyValueList) -> Self
New OwnedKeyValueList
node with an existing parent
fn root(values: Option<Box<SyncMultiSerialize>>) -> Self
New OwnedKeyValue
node without a parent (root)
fn parent(&self) -> &Option<OwnedKeyValueList>
Get the parent node element on the chain of values
Since OwnedKeyValueList
is just a chain of SyncMultiSerialize
instances: each
containing one more more OwnedKeyValue
, it's possible to iterate through the whole list
group-by-group with parent()
and values()
.
fn values(&self) -> Option<&SyncMultiSerialize>
Get the head node SyncMultiSerialize
values
fn iter(&self) -> OwnedKeyValueListIterator
Iterator over all OwnedKeyValue
-s in every SyncMultiSerialize
of the list
The order is reverse to how it was built. Eg.
#[macro_use] extern crate slog; fn main() { let drain = slog::Discard; let root = slog::Logger::root(drain, o!("k1" => "v1", "k2" => "k2")); let _log = root.new(o!("k3" => "v3", "k4" => "v4")); }
Will produce OwnedKeyValueList.iter()
that returns k4, k3, k2, k1
.
fn id(&self) -> usize
Get a unique stable identifier for this node
This function is buggy and will be removed at some point. Please see https://github.com/slog-rs/slog/issues/90
Trait Implementations
impl Clone for OwnedKeyValueList
[src]
fn clone(&self) -> OwnedKeyValueList
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more