Struct tracing_bunyan_formatter::JsonStorage[][src]

pub struct JsonStorage<'a> { /* fields omitted */ }

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

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]

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.

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.