Struct mentat_core::counter::RcCounter
[−]
[src]
pub struct RcCounter { /* fields omitted */ }
Methods
impl RcCounter
[src]
A simple shared counter.
pub fn with_initial(value: usize) -> Self
[src]
pub fn new() -> Self
[src]
pub fn next(&self) -> usize
[src]
Return the next value in the sequence.
use mentat_core::counter::RcCounter; let c = RcCounter::with_initial(3); assert_eq!(c.next(), 3); assert_eq!(c.next(), 4); let d = c.clone(); assert_eq!(d.next(), 5); assert_eq!(c.next(), 6);