[−][src]Struct metered::atomic::AtomicInt
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
Methods
impl<T: Copy> AtomicInt<T>
[src]
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 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 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<T: Default + Copy> Default for AtomicInt<T>
[src]
impl<T: Copy + Display> Debug for AtomicInt<T>
[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
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,