pub struct Target { /* fields omitted */ }
Expand description
A target for outputting metrics.
A new target can be created via new
, passing in the
requested output format. Individual metrics are appended to the target
via append
or the shortcut
append_simple
. Finally, when all metrics are
assembled, you can turn the target into a string of the output via
into_string
.
Implementations
Creates a new target.
The target will produce output in the given format.
Converts the target into a string with the assembled output.
Appends metrics to the target.
The method can append multiple metrics values at once via the closure.
All values are, however, for the same metrics described by metric
.
If the values are for a specific component, it’s name is given via
unit_name
. If they are global, this can be left at None
.
Append a single metric value to the target.
This is a shortcut version of append
when there is
only a single value to be append for a metric. The metric is described
by metric
. If the value is for a specific component, it’s name is
given via unit_name
. If they are global, this can be left at None
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Target
impl UnwindSafe for Target
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more