Trait dipstick::Prefixed

source ·
pub trait Prefixed {
    // Required methods
    fn get_prefixes(&self) -> &NameParts;
    fn add_prefix<S: Into<String>>(&self, name: S) -> Self;
    fn add_name<S: Into<String>>(&self, name: S) -> Self;
    fn named<S: Into<String>>(&self, name: S) -> Self;

    // Provided methods
    fn prefix_append<S: Into<MetricName>>(&self, name: S) -> MetricName { ... }
    fn prefix_prepend<S: Into<MetricName>>(&self, name: S) -> MetricName { ... }
}
Expand description

Name operations support.

Required Methods§

source

fn get_prefixes(&self) -> &NameParts

Returns namespace of component.

source

fn add_prefix<S: Into<String>>(&self, name: S) -> Self

👎Deprecated since 0.7.2: Use named() or add_name()

Append a name to the existing names. Return a clone of the component with the updated names.

source

fn add_name<S: Into<String>>(&self, name: S) -> Self

Append a name to the existing names. Return a clone of the component with the updated names.

source

fn named<S: Into<String>>(&self, name: S) -> Self

Replace any existing names with a single name. Return a clone of the component with the new name. If multiple names are required, add_name may also be used.

Provided Methods§

source

fn prefix_append<S: Into<MetricName>>(&self, name: S) -> MetricName

Append any name parts to the name’s namespace.

source

fn prefix_prepend<S: Into<MetricName>>(&self, name: S) -> MetricName

Prepend any name parts to the name’s namespace.

Object Safety§

This trait is not object safe.

Implementors§