Struct bobbytables::Counter
[−]
[src]
pub struct Counter { /* fields omitted */ }
The public Counter structure which contains the inner mutable state. This allows us to put this straight into an Arc and safely share between threads
Methods
impl Counter
[src]
fn new() -> Counter
Create a new counter, which is has an UnsafeCell wrapping the actual counter implementation.
fn incr(&self, key: &str, count: usize) -> usize
Extract the mutable reference to the counter implementation and increment the given key.
fn get(&self, key: &str) -> usize
Extract the mutable reference to the counter implementation and return the current counter value for the given key.