pub struct AtomicNumber(/* private fields */);
Available on crate feature
metrics
only.Expand description
An atomic version of Number
Implementations§
Source§impl AtomicNumber
impl AtomicNumber
Sourcepub fn fetch_add(&self, number_kind: &NumberKind, val: &Number)
pub fn fetch_add(&self, number_kind: &NumberKind, val: &Number)
Adds to the current number. Both numbers must be of the same kind.
This operation wraps around on overflow for u64
and i64
types and is
inf
for f64
.
Sourcepub fn fetch_sub(&self, number_kind: &NumberKind, val: &Number)
pub fn fetch_sub(&self, number_kind: &NumberKind, val: &Number)
Subtracts from the current number. Both numbers must be of the same kind.
This operation wraps around on overflow for u64
and i64
types and is
-inf
for f64
.
Trait Implementations§
Source§impl Clone for AtomicNumber
impl Clone for AtomicNumber
Source§impl Debug for AtomicNumber
impl Debug for AtomicNumber
Source§impl Default for AtomicNumber
impl Default for AtomicNumber
Source§fn default() -> AtomicNumber
fn default() -> AtomicNumber
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for AtomicNumber
impl RefUnwindSafe for AtomicNumber
impl Send for AtomicNumber
impl Sync for AtomicNumber
impl Unpin for AtomicNumber
impl UnwindSafe for AtomicNumber
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Available on crate feature
trace
only.Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Available on crate feature
trace
only.