Trait tracing_subscriber::fmt::FormatFields [−][src]
A type that can format a set of fields to a fmt::Write
.
FormatFields
is primarily used in the context of FmtSubscriber
. Each
time a span or event with fields is recorded, the subscriber will format
those fields with its associated FormatFields
implementation.
Required methods
fn format_fields<R: RecordFields>(
&self,
writer: &'writer mut dyn Write,
fields: R
) -> Result
[src]
&self,
writer: &'writer mut dyn Write,
fields: R
) -> Result
Format the provided fields
to the provided writer
, returning a result.
Provided methods
fn add_fields(
&self,
current: &'writer mut String,
fields: &Record<'_>
) -> Result
[src]
&self,
current: &'writer mut String,
fields: &Record<'_>
) -> Result
Record additional field(s) on an existing span.
By default, this appends a space to the current set of fields if it is
non-empty, and then calls self.format_fields
. If different behavior is
required, the default implementation of this method can be overridden.
Implementors
impl<'a> FormatFields<'a> for JsonFields
[src]
fn format_fields<R: RecordFields>(
&self,
writer: &'a mut dyn Write,
fields: R
) -> Result
[src]
&self,
writer: &'a mut dyn Write,
fields: R
) -> Result
Format the provided fields
to the provided writer
, returning a result.
fn add_fields(&self, current: &'a mut String, fields: &Record<'_>) -> Result
[src]
Record additional field(s) on an existing span.
By default, this appends a space to the current set of fields if it is
non-empty, and then calls self.format_fields
. If different behavior is
required, the default implementation of this method can be overridden.
impl<'cx, 'writer, S, N> FormatFields<'writer> for FmtContext<'cx, S, N> where
S: Subscriber + for<'lookup> LookupSpan<'lookup>,
N: FormatFields<'writer> + 'static,
[src]
S: Subscriber + for<'lookup> LookupSpan<'lookup>,
N: FormatFields<'writer> + 'static,
fn format_fields<R: RecordFields>(
&self,
writer: &'writer mut dyn Write,
fields: R
) -> Result
[src]
&self,
writer: &'writer mut dyn Write,
fields: R
) -> Result
impl<'writer> FormatFields<'writer> for Pretty
[src]
fn format_fields<R: RecordFields>(
&self,
writer: &'writer mut dyn Write,
fields: R
) -> Result
[src]
&self,
writer: &'writer mut dyn Write,
fields: R
) -> Result
fn add_fields(
&self,
current: &'writer mut String,
fields: &Record<'_>
) -> Result
[src]
&self,
current: &'writer mut String,
fields: &Record<'_>
) -> Result
impl<'writer, M> FormatFields<'writer> for M where
M: MakeOutput<&'writer mut dyn Write, Result>,
M::Visitor: VisitFmt + VisitOutput<Result>,
[src]
M: MakeOutput<&'writer mut dyn Write, Result>,
M::Visitor: VisitFmt + VisitOutput<Result>,
fn format_fields<R: RecordFields>(
&self,
writer: &'writer mut dyn Write,
fields: R
) -> Result
[src]
&self,
writer: &'writer mut dyn Write,
fields: R
) -> Result