pub struct JsonStorage<'a> { /* private fields */ }
Expand description
JsonStorage
will collect information about a span when it’s created (new_span
handler)
or when new records are attached to it (on_record
handler) and store it in its extensions
for future retrieval from other layers interested in formatting or further enrichment.
We are re-implementing (well, copy-pasting, apart from using an HashMap instead of a BTreeMap)
JsonVisitor
from tracing-subscriber
given that we can’t access/insert/iterate over
the underlying BTreeMap using its public API.
For spans, we also store the duration of each span with the elapsed_milliseconds
key using
the on_exit
/on_enter
handlers.
Implementations§
Trait Implementations§
Source§impl<'a> Clone for JsonStorage<'a>
impl<'a> Clone for JsonStorage<'a>
Source§fn clone(&self) -> JsonStorage<'a>
fn clone(&self) -> JsonStorage<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'a> Debug for JsonStorage<'a>
impl<'a> Debug for JsonStorage<'a>
Source§impl Default for JsonStorage<'_>
impl Default for JsonStorage<'_>
Get a new visitor, with an empty bag of key-value pairs.
Source§impl Visit for JsonStorage<'_>
impl Visit for JsonStorage<'_>
Taken verbatim from tracing-subscriber
Source§fn record_i64(&mut self, field: &Field, value: i64)
fn record_i64(&mut self, field: &Field, value: i64)
Visit a signed 64-bit integer value.
Source§fn record_u64(&mut self, field: &Field, value: u64)
fn record_u64(&mut self, field: &Field, value: u64)
Visit an unsigned 64-bit integer value.
Source§fn record_f64(&mut self, field: &Field, value: f64)
fn record_f64(&mut self, field: &Field, value: f64)
Visit a 64-bit floating point value.
Source§fn record_bool(&mut self, field: &Field, value: bool)
fn record_bool(&mut self, field: &Field, value: bool)
Visit a boolean value.
Source§fn record_str(&mut self, field: &Field, value: &str)
fn record_str(&mut self, field: &Field, value: &str)
Visit a string value.
Source§fn record_debug(&mut self, field: &Field, value: &dyn Debug)
fn record_debug(&mut self, field: &Field, value: &dyn Debug)
fmt::Debug
.