Enum sentry_core::metrics::MetricUnit
source · pub enum MetricUnit {
Duration(DurationUnit),
Information(InformationUnit),
Fraction(FractionUnit),
Custom(Cow<'static, str>),
None,
}
Expand description
The unit of measurement of a metric value.
Units augment metric values by giving them a magnitude and semantics. There are certain types of units that are subdivided in their precision:
DurationUnit
: time durationsInformationUnit
: sizes of information
You are not restricted to these units, but can use any &'static str
or String
as a unit.
Variants§
Duration(DurationUnit)
A time duration, defaulting to "millisecond"
.
Information(InformationUnit)
Size of information derived from bytes, defaulting to "byte"
.
Fraction(FractionUnit)
Fractions such as percentages, defaulting to "ratio"
.
Custom(Cow<'static, str>)
user-defined units without builtin conversion or default.
None
Untyped value without a unit (""
).
Implementations§
Trait Implementations§
source§impl Clone for MetricUnit
impl Clone for MetricUnit
source§fn clone(&self) -> MetricUnit
fn clone(&self) -> MetricUnit
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for MetricUnit
impl Debug for MetricUnit
source§impl Default for MetricUnit
impl Default for MetricUnit
source§fn default() -> MetricUnit
fn default() -> MetricUnit
Returns the “default value” for a type. Read more
source§impl Display for MetricUnit
impl Display for MetricUnit
source§impl From<&'static str> for MetricUnit
impl From<&'static str> for MetricUnit
source§impl From<DurationUnit> for MetricUnit
impl From<DurationUnit> for MetricUnit
source§fn from(unit: DurationUnit) -> Self
fn from(unit: DurationUnit) -> Self
Converts to this type from the input type.
source§impl From<FractionUnit> for MetricUnit
impl From<FractionUnit> for MetricUnit
source§fn from(unit: FractionUnit) -> Self
fn from(unit: FractionUnit) -> Self
Converts to this type from the input type.
source§impl From<InformationUnit> for MetricUnit
impl From<InformationUnit> for MetricUnit
source§fn from(unit: InformationUnit) -> Self
fn from(unit: InformationUnit) -> Self
Converts to this type from the input type.
source§impl From<String> for MetricUnit
impl From<String> for MetricUnit
source§impl FromStr for MetricUnit
impl FromStr for MetricUnit
source§impl Hash for MetricUnit
impl Hash for MetricUnit
source§impl PartialEq for MetricUnit
impl PartialEq for MetricUnit
source§fn eq(&self, other: &MetricUnit) -> bool
fn eq(&self, other: &MetricUnit) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for MetricUnit
impl StructuralPartialEq for MetricUnit
Auto Trait Implementations§
impl Freeze for MetricUnit
impl RefUnwindSafe for MetricUnit
impl Send for MetricUnit
impl Sync for MetricUnit
impl Unpin for MetricUnit
impl UnwindSafe for MetricUnit
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more