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§
sourcefn get_prefixes(&self) -> &NameParts
fn get_prefixes(&self) -> &NameParts
Returns namespace of component.
sourcefn add_prefix<S: Into<String>>(&self, name: S) -> Self
👎Deprecated since 0.7.2: Use named() or add_name()
fn add_prefix<S: Into<String>>(&self, name: S) -> Self
Append a name to the existing names. Return a clone of the component with the updated names.
Provided Methods§
sourcefn prefix_append<S: Into<MetricName>>(&self, name: S) -> MetricName
fn prefix_append<S: Into<MetricName>>(&self, name: S) -> MetricName
Append any name parts to the name’s namespace.
sourcefn prefix_prepend<S: Into<MetricName>>(&self, name: S) -> MetricName
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.