Struct orx_concurrent_iter::AtomicCounter
source · pub struct AtomicCounter { /* private fields */ }
Expand description
An atomic counter, simply a wrapper around AtomicUsize
with utility methods useful for atomic iterators.
Implementations§
source§impl AtomicCounter
impl AtomicCounter
sourcepub fn fetch_and_add(&self, len: usize) -> usize
pub fn fetch_and_add(&self, len: usize) -> usize
Fetches and returns the current value of the counter, and adds len
to it.
sourcepub fn fetch_and_increment(&self) -> usize
pub fn fetch_and_increment(&self) -> usize
Fetches and returns the current value of the counter, and adds 1
to it.
Trait Implementations§
source§impl Clone for AtomicCounter
impl Clone for AtomicCounter
source§impl Debug for AtomicCounter
impl Debug for AtomicCounter
Auto Trait Implementations§
impl !Freeze for AtomicCounter
impl RefUnwindSafe for AtomicCounter
impl Send for AtomicCounter
impl Sync for AtomicCounter
impl Unpin for AtomicCounter
impl UnwindSafe for AtomicCounter
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more