Struct serif::FieldFormatter
source · pub struct FieldFormatter { /* private fields */ }
Expand description
Serif’s formatter for event and span metadata fields.
FieldFormatter
is intended to be used with SubscriberBuilder::fmt_fields
and is designed
to work with EventFormatter
’s output format.
FieldFormatter
implements FormatFields
, though this isn’t immediately clear in Rustdoc.
Specifically, FieldFormatter
implements MakeVisitor
, and FieldVisitor
implements
Visit
, VisitOutput
, and VisitFmt
. Thanks to blanket impls in the
tracing_subscriber
crate, this means that FieldFormatter
implements FormatFields
.
§Field Format
If a field is named message
, then it’s printed in the default text style. All other fields
are formatted in square brackets and dimmed text style like [name=value]
. Padding is added on
either side of the message
field, but not around other fields.
Implementations§
Trait Implementations§
source§impl Clone for FieldFormatter
impl Clone for FieldFormatter
source§fn clone(&self) -> FieldFormatter
fn clone(&self) -> FieldFormatter
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for FieldFormatter
impl Debug for FieldFormatter
source§impl Default for FieldFormatter
impl Default for FieldFormatter
source§impl<'a> MakeVisitor<Writer<'a>> for FieldFormatter
impl<'a> MakeVisitor<Writer<'a>> for FieldFormatter
§type Visitor = FieldVisitor<'a>
type Visitor = FieldVisitor<'a>
The visitor type produced by this
MakeVisitor
.source§fn make_visitor(&self, target: Writer<'a>) -> Self::Visitor
fn make_visitor(&self, target: Writer<'a>) -> Self::Visitor
Make a new visitor for the provided
target
.Auto Trait Implementations§
impl Freeze for FieldFormatter
impl RefUnwindSafe for FieldFormatter
impl Send for FieldFormatter
impl Sync for FieldFormatter
impl Unpin for FieldFormatter
impl UnwindSafe for FieldFormatter
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more