Skip to main content

FormatSpan

Trait FormatSpan 

Source
pub trait FormatSpan: 'static {
    // Required methods
    fn find_details<'ext>(&self, ext: &'ext Extensions<'_>) -> Option<&'ext str>;
    fn add_details(&self, ext: &mut ExtensionsMut<'_>, attrs: &Attributes<'_>);
    fn record_values(&self, ext: &mut ExtensionsMut<'_>, values: &Record<'_>);
}
Expand description

Determine what additional information will be attached to the performance events.

Required Methods§

Source

fn find_details<'ext>(&self, ext: &'ext Extensions<'_>) -> Option<&'ext str>

Find the details in the extensions of a span that will be recorded with the event.

Source

fn add_details(&self, ext: &mut ExtensionsMut<'_>, attrs: &Attributes<'_>)

Called when a span is constructed, with its initial attributes.

This method should insert, for later consumption in Self::find_details, a description of the details.

Source

fn record_values(&self, ext: &mut ExtensionsMut<'_>, values: &Record<'_>)

Called when a span records some values.

This method should modify, for later consumption in Self::find_details, the description of the details.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FormatSpan for ()

Source§

fn find_details<'ext>(&self, _: &'ext Extensions<'_>) -> Option<&'ext str>

Source§

fn add_details(&self, _: &mut ExtensionsMut<'_>, _: &Attributes<'_>)

Source§

fn record_values(&self, _: &mut ExtensionsMut<'_>, _: &Record<'_>)

Implementors§

Source§

impl<N> FormatSpan for FormatSpanFromFields<N>
where N: 'static + for<'writer> FormatFields<'writer>,