forked from torrust/torrust-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunit.rs
More file actions
30 lines (28 loc) · 714 Bytes
/
unit.rs
File metadata and controls
30 lines (28 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//! This module defines the `Unit` enum, which represents various units of
//! measurement.
//!
//! The `Unit` enum is used to specify the unit of measurement for metrics.
//!
//! They were copied from the `metrics` crate, to allow future compatibility.
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum Unit {
Count,
Percent,
Seconds,
Milliseconds,
Microseconds,
Nanoseconds,
Tebibytes,
Gibibytes,
Mebibytes,
Kibibytes,
Bytes,
TerabitsPerSecond,
GigabitsPerSecond,
MegabitsPerSecond,
KilobitsPerSecond,
BitsPerSecond,
CountPerSecond,
}