🛈 Note: This is pre-release documentation for the upcoming tracing 0.2.0 ecosystem.

For the release documentation, please see docs.rs, instead.

tracing_subscriber::field

Trait MakeVisitor

Source
pub trait MakeVisitor<T> {
    type Visitor: Visit;

    // Required method
    fn make_visitor(&self, target: T) -> Self::Visitor;
}
Expand description

Creates new visitors.

A type implementing MakeVisitor represents a composable factory for types implementing the Visit trait. The MakeVisitor trait defines a single function, make_visitor, which takes in a T-typed target and returns a type implementing Visit configured for that target. A target may be a string, output stream, or data structure that the visitor will record data to, configuration variables that determine the visitor’s behavior, or () when no input is required to produce a visitor.

Required Associated Types§

Source

type Visitor: Visit

The visitor type produced by this MakeVisitor.

Required Methods§

Source

fn make_visitor(&self, target: T) -> Self::Visitor

Make a new visitor for the provided target.

Implementors§

Source§

impl<'a> MakeVisitor<Writer<'a>> for DefaultFields

Available on crate features fmt and std only.
Source§

impl<'a> MakeVisitor<Writer<'a>> for PrettyFields

Available on crate features fmt and std only.
Source§

impl<'a, F> MakeVisitor<Writer<'a>> for FieldFn<F>
where F: Fn(&mut Writer<'a>, &Field, &dyn Debug) -> Result + Clone,

Available on crate features fmt and std only.
Source§

impl<D, V, T> MakeVisitor<T> for Delimited<D, V>
where D: AsRef<str> + Clone, V: MakeVisitor<T>, V::Visitor: VisitFmt,

Source§

impl<T, V> MakeVisitor<T> for Alt<V>
where V: MakeVisitor<T>,

Source§

impl<T, V> MakeVisitor<T> for Messages<V>
where V: MakeVisitor<T>,

Source§

impl<T, V, F> MakeVisitor<T> for F
where F: Fn(T) -> V, V: Visit,