[][src]Struct metered::atomic::AtomicInt

pub struct AtomicInt<T: Copy> {
    pub inner: Atomic<T>,
}

A new-type wrapper over atomic::Atomic that supports serde serialization and a cleaner debug output.

All default operations on the wrapper type are using a relaxed memory ordering, which makes it suitable for counters and little else.

Fields

inner: Atomic<T>

The inner atomic instance

Implementations

impl<T: Copy> AtomicInt<T>[src]

pub fn get(&self) -> T[src]

Returns the current value with a relaxed

impl AtomicInt<u8>[src]

pub fn incr(&self) -> u8[src]

Increments self

pub fn decr(&self) -> u8[src]

Decrements self

pub fn set(&self, v: u8)[src]

Sets self to a new value

impl AtomicInt<u16>[src]

pub fn incr(&self) -> u16[src]

Increments self

pub fn decr(&self) -> u16[src]

Decrements self

pub fn set(&self, v: u16)[src]

Sets self to a new value

impl AtomicInt<u32>[src]

pub fn incr(&self) -> u32[src]

Increments self

pub fn decr(&self) -> u32[src]

Decrements self

pub fn set(&self, v: u32)[src]

Sets self to a new value

impl AtomicInt<u64>[src]

pub fn incr(&self) -> u64[src]

Increments self

pub fn decr(&self) -> u64[src]

Decrements self

pub fn set(&self, v: u64)[src]

Sets self to a new value

impl AtomicInt<u128>[src]

pub fn incr(&self) -> u128[src]

Increments self

pub fn decr(&self) -> u128[src]

Decrements self

pub fn set(&self, v: u128)[src]

Sets self to a new value

Trait Implementations

impl Clear for AtomicInt<u8>[src]

impl Clear for AtomicInt<u16>[src]

impl Clear for AtomicInt<u32>[src]

impl Clear for AtomicInt<u64>[src]

impl Clear for AtomicInt<u128>[src]

impl Clearable for AtomicInt<u8>[src]

impl Clearable for AtomicInt<u16>[src]

impl Clearable for AtomicInt<u32>[src]

impl Clearable for AtomicInt<u64>[src]

impl Clearable for AtomicInt<u128>[src]

impl Counter for AtomicInt<u8>[src]

impl Counter for AtomicInt<u16>[src]

impl Counter for AtomicInt<u32>[src]

impl Counter for AtomicInt<u64>[src]

impl Counter for AtomicInt<u128>[src]

impl<T: Copy + Display> Debug for AtomicInt<T>[src]

impl<T: Default + Copy> Default for AtomicInt<T>[src]

impl Gauge for AtomicInt<u8>[src]

impl Gauge for AtomicInt<u16>[src]

impl Gauge for AtomicInt<u32>[src]

impl Gauge for AtomicInt<u64>[src]

impl Gauge for AtomicInt<u128>[src]

impl Serialize for AtomicInt<u8>[src]

impl Serialize for AtomicInt<u16>[src]

impl Serialize for AtomicInt<u32>[src]

impl Serialize for AtomicInt<u64>[src]

impl Serialize for AtomicInt<u128>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for AtomicInt<T>

impl<T> Send for AtomicInt<T> where
    T: Send

impl<T> Sync for AtomicInt<T> where
    T: Send

impl<T> Unpin for AtomicInt<T> where
    T: Unpin

impl<T> UnwindSafe for AtomicInt<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.