16
16
17
17
use std:: fmt:: Debug ;
18
18
19
- use dyn_clone:: DynClone ;
20
-
21
19
/// The metrics type.
22
- pub trait Metrics : Send + Sync + DynClone + Debug {
20
+ pub trait Metrics : Send + Sync + Debug {
23
21
/// Create a [`Counter`] with an optional `unit_label`.
24
22
///
25
23
/// The `unit_label` can be used to indicate what the unit of the value is, e.g. "kb" or
@@ -115,7 +113,7 @@ pub trait Metrics: Send + Sync + DynClone + Debug {
115
113
/// ```text
116
114
/// version{semver="0.1.0", rev="891c5baa5"} 1
117
115
/// ```
118
- pub trait MetricsFamily < M > : Send + Sync + DynClone + Debug {
116
+ pub trait MetricsFamily < M > : Send + Sync + Debug {
119
117
/// Instantiate a metric in this family with a specific label vector.
120
118
///
121
119
/// The given values of `labels` are used to identify this metric within its family. It must
@@ -224,13 +222,13 @@ impl MetricsFamily<()> for NoMetrics {
224
222
}
225
223
226
224
/// An ever-incrementing counter
227
- pub trait Counter : Send + Sync + Debug + DynClone {
225
+ pub trait Counter : Send + Sync + Debug {
228
226
/// Add a value to the counter
229
227
fn add ( & self , amount : usize ) ;
230
228
}
231
229
232
230
/// A gauge that stores the latest value.
233
- pub trait Gauge : Send + Sync + Debug + DynClone {
231
+ pub trait Gauge : Send + Sync + Debug {
234
232
/// Set the gauge value
235
233
fn set ( & self , amount : usize ) ;
236
234
@@ -239,16 +237,11 @@ pub trait Gauge: Send + Sync + Debug + DynClone {
239
237
}
240
238
241
239
/// A histogram which will record a series of points.
242
- pub trait Histogram : Send + Sync + Debug + DynClone {
240
+ pub trait Histogram : Send + Sync + Debug {
243
241
/// Add a point to this histogram.
244
242
fn add_point ( & self , point : f64 ) ;
245
243
}
246
244
247
- dyn_clone:: clone_trait_object!( Metrics ) ;
248
- dyn_clone:: clone_trait_object!( Gauge ) ;
249
- dyn_clone:: clone_trait_object!( Counter ) ;
250
- dyn_clone:: clone_trait_object!( Histogram ) ;
251
-
252
245
#[ cfg( test) ]
253
246
mod test {
254
247
use std:: {
0 commit comments