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

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

Returns the current value

Increments self

Returns the previous count

Increments self by count

Returns the previous count

Decrements self

Returns the previous count

Decrements self by count

Returns the previous count

Sets self to a new value

Increments self

Returns the previous count

Increments self by count

Returns the previous count

Decrements self

Returns the previous count

Decrements self by count

Returns the previous count

Sets self to a new value

Increments self

Returns the previous count

Increments self by count

Returns the previous count

Decrements self

Returns the previous count

Decrements self by count

Returns the previous count

Sets self to a new value

Increments self

Returns the previous count

Increments self by count

Returns the previous count

Decrements self

Returns the previous count

Decrements self by count

Returns the previous count

Sets self to a new value

Increments self

Returns the previous count

Increments self by count

Returns the previous count

Decrements self

Returns the previous count

Decrements self by count

Returns the previous count

Sets self to a new value

Trait Implementations

Requests to clear self.

Requests to clear self.

Requests to clear self.

Requests to clear self.

Requests to clear self.

Returns true if self has been cleared and not yet been written to since.

Returns true if self has been cleared and not yet been written to since.

Returns true if self has been cleared and not yet been written to since.

Returns true if self has been cleared and not yet been written to since.

Returns true if self has been cleared and not yet been written to since.

Increment the counter by count in one step Read more

Increment the counter

Increment the counter by count in one step Read more

Increment the counter

Increment the counter by count in one step Read more

Increment the counter

Increment the counter by count in one step Read more

Increment the counter

Increment the counter by count in one step Read more

Increment the counter

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Increment the gauge by count in one step Read more

Decrement the gauge by count in one step Read more

Increment the counter

Decrement the counter

Increment the gauge by count in one step Read more

Decrement the gauge by count in one step Read more

Increment the counter

Decrement the counter

Increment the gauge by count in one step Read more

Decrement the gauge by count in one step Read more

Increment the counter

Decrement the counter

Increment the gauge by count in one step Read more

Decrement the gauge by count in one step Read more

Increment the counter

Decrement the counter

Increment the gauge by count in one step Read more

Decrement the gauge by count in one step Read more

Increment the counter

Decrement the counter

Serialize this value into the given Serde serializer. Read more

Serialize this value into the given Serde serializer. Read more

Serialize this value into the given Serde serializer. Read more

Serialize this value into the given Serde serializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.