pub struct MetricMetadata {
pub id: MetricId,
pub metric_type: MetricType,
pub description: String,
pub unit: String,
pub created_at: Instant,
pub last_updated: Instant,
}
Expand description
Descriptive, static metadata about a metric.
Fields§
§id: MetricId
The metric’s unique identifier.
metric_type: MetricType
The type of the metric.
description: String
A human-readable description of what the metric measures.
unit: String
The unit of measurement (e.g., “ms”, “bytes”).
created_at: Instant
The timestamp when this metric was first registered.
last_updated: Instant
The timestamp when this metric was last updated.
Implementations§
Source§impl MetricMetadata
impl MetricMetadata
Sourcepub fn new(
id: MetricId,
metric_type: MetricType,
description: impl Into<String>,
unit: impl Into<String>,
) -> Self
pub fn new( id: MetricId, metric_type: MetricType, description: impl Into<String>, unit: impl Into<String>, ) -> Self
Creates new metadata for a metric.
Sourcepub fn update_timestamp(&mut self)
pub fn update_timestamp(&mut self)
Updates the last_updated
timestamp to the current time.
Trait Implementations§
Source§impl Clone for MetricMetadata
impl Clone for MetricMetadata
Source§fn clone(&self) -> MetricMetadata
fn clone(&self) -> MetricMetadata
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for MetricMetadata
impl RefUnwindSafe for MetricMetadata
impl Send for MetricMetadata
impl Sync for MetricMetadata
impl Unpin for MetricMetadata
impl UnwindSafe for MetricMetadata
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