Struct mentat_core::counter::RcCounter [] [src]

pub struct RcCounter { /* fields omitted */ }

Methods

impl RcCounter
[src]

A simple shared counter.

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);

Trait Implementations

impl Clone for RcCounter
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl !Send for RcCounter

impl !Sync for RcCounter