[−][src]Struct tracing_bunyan_formatter::JsonStorage
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.
Methods
impl<'a> JsonStorage<'a>
[src]
pub fn values(&self) -> &HashMap<&'a str, Value>
[src]
Get the set of stored values, as a set of keys and JSON values.
Trait Implementations
impl<'a> Clone for JsonStorage<'a>
[src]
fn clone(&self) -> JsonStorage<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Debug for JsonStorage<'a>
[src]
impl<'_> Default for JsonStorage<'_>
[src]
Get a new visitor, with an empty bag of key-value pairs.
impl<'_> Visit for JsonStorage<'_>
[src]
Taken verbatim from tracing-subscriber
fn record_i64(&mut self, field: &Field, value: i64)
[src]
Visit a signed 64-bit integer value.
fn record_u64(&mut self, field: &Field, value: u64)
[src]
Visit an unsigned 64-bit integer value.
fn record_bool(&mut self, field: &Field, value: bool)
[src]
Visit a boolean value.
fn record_str(&mut self, field: &Field, value: &str)
[src]
Visit a string value.
fn record_debug(&mut self, field: &Field, value: &dyn Debug)
[src]
fn record_error(&mut self, field: &Field, value: &(dyn Error + 'static))
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for JsonStorage<'a>
impl<'a> Send for JsonStorage<'a>
impl<'a> Sync for JsonStorage<'a>
impl<'a> Unpin for JsonStorage<'a>
impl<'a> UnwindSafe for JsonStorage<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<F> Visit for F where
F: FnMut(&Field, &dyn Debug),
[src]
F: FnMut(&Field, &dyn Debug),