[][src]Struct bioyino_metric::name::MetricName

pub struct MetricName {
    pub name: Bytes,
    // some fields omitted
}

Represents a metric name as a buffer containing the full metric name including tags. Also provides methods to work with tags.

Fields

name: Bytes

Methods

impl MetricName[src]

pub fn new<B: AsMut<[u8]>>(
    name: BytesMut,
    mode: TagFormat,
    intermediate: &mut B
) -> Result<Self, ()>
[src]

pub fn new_untagged(name: BytesMut) -> Self[src]

Convenience method to create metric that is for sure has no tags in any format

pub fn from_raw_parts(name: Bytes, tag_pos: Option<usize>) -> Self[src]

Assemble name from internal parts without checks. Tags must be sorted, tag position must be found according to required format

pub fn has_tags(&mut self) -> bool[src]

true if metric is tagged

pub fn name_without_tags(&self) -> &[u8][src]

returns only name, without tags, considers tag position was already found before

pub fn name_with_tags(&self) -> &[u8][src]

returns slice with full name, including tags

pub fn tags_without_name(&self) -> &[u8][src]

returns slice with only tags, includes leading semicolon, expects tag position was already found

pub fn tags_len(&self) -> usize[src]

returns length of tags field, including leading semicolon considers tag position was already found before

pub fn put_with_aggregate<F>(
    &self,
    buf: &mut BytesMut,
    dest: AggregationDestination,
    agg: Aggregate<F>,
    postfix_replacements: &HashMap<Aggregate<F>, String>,
    prefix_replacements: &HashMap<Aggregate<F>, String>,
    tag_replacements: &HashMap<Aggregate<F>, String>
) -> Result<(), ()> where
    F: Float + Debug + FromF64 + AsPrimitive<usize>, 
[src]

Puts a name with an aggregate to provided buffer depending on dest. To avoid putting different aggregates into same names requires all replacements to exist, giving error otherwise. Does no do the check if such overriding is done.

Trait Implementations

impl Clone for MetricName[src]

impl Debug for MetricName[src]

impl Eq for MetricName[src]

impl Hash for MetricName[src]

impl PartialEq<MetricName> for MetricName[src]

impl StructuralEq for MetricName[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.