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.
fn get_index(&self, index: usize) -> Option<(String, usize)>
fn size(&self) -> usize
Trait Implementations
impl<'a> IntoIterator for &'a Counter
[src]
type Item = (String, usize)
The type of the elements being iterated over.
type IntoIter = CounterIterator<'a>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more