[−][src]Struct bioyino_metric::name::MetricName
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]
name: BytesMut,
mode: TagFormat,
intermediate: &mut B
) -> Result<Self, ()>
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]
&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>,
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]
fn clone(&self) -> MetricName
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for MetricName
[src]
impl Eq for MetricName
[src]
impl Hash for MetricName
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<MetricName> for MetricName
[src]
impl StructuralEq for MetricName
[src]
Auto Trait Implementations
impl RefUnwindSafe for MetricName
impl Send for MetricName
impl Sync for MetricName
impl Unpin for MetricName
impl UnwindSafe for MetricName
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,