use crate::common::ValueHandle;
#[derive(Clone)]
pub struct Counter {
handle: ValueHandle,
}
impl Counter {
pub fn record(&self, value: u64) {
self.handle.update_counter(value);
}
pub fn increment(&self) {
self.handle.update_counter(1);
}
}
impl From<ValueHandle> for Counter {
fn from(handle: ValueHandle) -> Self {
Self { handle }
}
}