Trait tracing_subscriber::field::RecordFields [−][src]
Extension trait implemented by types which can be recorded by a visitor.
This allows writing code that is generic over tracing_core
’s
span::Attributes
, span::Record
, and Event
types. These types all provide inherent record
methods that allow a
visitor to record their fields, but there is no common trait representing this.
With RecordFields
, we can write code like this:
use tracing_core::field::Visit; use tracing_subscriber::field::RecordFields; struct MyVisitor { // ... } impl Visit for MyVisitor { // ... } fn record_with_my_visitor<R>(r: R) where R: RecordFields, { let mut visitor = MyVisitor::new(); r.record(&mut visitor); }
Required methods
fn record(&self, visitor: &mut dyn Visit)
[src]
Record all the fields in self
with the provided visitor
.
Implementations on Foreign Types
impl<'a> RecordFields for Event<'a>
[src]
impl<'a> RecordFields for Attributes<'a>
[src]
impl<'a> RecordFields for Record<'a>
[src]
impl<'a, F> RecordFields for &'a F where
F: RecordFields,
[src]
Loading content...F: RecordFields,