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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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