[−][src]Trait atomig::impls::AtomicImpl
Common interface of all atomic types in std::sync::atomic
.
This trait is exactly implemented for all atomic types in
std::sync::atomic
and you cannot and should not implement this trait for
your own types. Instead of using these methods directly, use
Atomic
which has the same interface.
Associated Types
type Inner: PrimitiveAtom<Impl = Self>
Required methods
fn new(v: Self::Inner) -> Self
fn get_mut(&mut self) -> &mut Self::Inner
fn into_inner(self) -> Self::Inner
fn load(&self, order: Ordering) -> Self::Inner
fn store(&self, v: Self::Inner, order: Ordering)
fn swap(&self, v: Self::Inner, order: Ordering) -> Self::Inner
fn compare_and_swap(
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
fn compare_exchange(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
fn compare_exchange_weak(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
Implementations on Foreign Types
impl<T> AtomicImpl for AtomicPtr<T>
[src]
type Inner = *mut T
fn new(v: Self::Inner) -> Self
[src]
fn get_mut(&mut self) -> &mut Self::Inner
[src]
fn into_inner(self) -> Self::Inner
[src]
fn load(&self, order: Ordering) -> Self::Inner
[src]
fn store(&self, v: Self::Inner, order: Ordering)
[src]
fn swap(&self, v: Self::Inner, order: Ordering) -> Self::Inner
[src]
fn compare_and_swap(
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
[src]
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
fn compare_exchange(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
fn compare_exchange_weak(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
impl AtomicImpl for AtomicBool
[src]
type Inner = bool
fn new(v: Self::Inner) -> Self
[src]
fn get_mut(&mut self) -> &mut Self::Inner
[src]
fn into_inner(self) -> Self::Inner
[src]
fn load(&self, order: Ordering) -> Self::Inner
[src]
fn store(&self, v: Self::Inner, order: Ordering)
[src]
fn swap(&self, v: Self::Inner, order: Ordering) -> Self::Inner
[src]
fn compare_and_swap(
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
[src]
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
fn compare_exchange(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
fn compare_exchange_weak(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
impl AtomicImpl for AtomicU8
[src]
type Inner = u8
fn new(v: Self::Inner) -> Self
[src]
fn get_mut(&mut self) -> &mut Self::Inner
[src]
fn into_inner(self) -> Self::Inner
[src]
fn load(&self, order: Ordering) -> Self::Inner
[src]
fn store(&self, v: Self::Inner, order: Ordering)
[src]
fn swap(&self, v: Self::Inner, order: Ordering) -> Self::Inner
[src]
fn compare_and_swap(
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
[src]
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
fn compare_exchange(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
fn compare_exchange_weak(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
impl AtomicImpl for AtomicI8
[src]
type Inner = i8
fn new(v: Self::Inner) -> Self
[src]
fn get_mut(&mut self) -> &mut Self::Inner
[src]
fn into_inner(self) -> Self::Inner
[src]
fn load(&self, order: Ordering) -> Self::Inner
[src]
fn store(&self, v: Self::Inner, order: Ordering)
[src]
fn swap(&self, v: Self::Inner, order: Ordering) -> Self::Inner
[src]
fn compare_and_swap(
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
[src]
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
fn compare_exchange(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
fn compare_exchange_weak(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
impl AtomicImpl for AtomicU16
[src]
type Inner = u16
fn new(v: Self::Inner) -> Self
[src]
fn get_mut(&mut self) -> &mut Self::Inner
[src]
fn into_inner(self) -> Self::Inner
[src]
fn load(&self, order: Ordering) -> Self::Inner
[src]
fn store(&self, v: Self::Inner, order: Ordering)
[src]
fn swap(&self, v: Self::Inner, order: Ordering) -> Self::Inner
[src]
fn compare_and_swap(
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
[src]
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
fn compare_exchange(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
fn compare_exchange_weak(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
impl AtomicImpl for AtomicI16
[src]
type Inner = i16
fn new(v: Self::Inner) -> Self
[src]
fn get_mut(&mut self) -> &mut Self::Inner
[src]
fn into_inner(self) -> Self::Inner
[src]
fn load(&self, order: Ordering) -> Self::Inner
[src]
fn store(&self, v: Self::Inner, order: Ordering)
[src]
fn swap(&self, v: Self::Inner, order: Ordering) -> Self::Inner
[src]
fn compare_and_swap(
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
[src]
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
fn compare_exchange(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
fn compare_exchange_weak(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
impl AtomicImpl for AtomicU32
[src]
type Inner = u32
fn new(v: Self::Inner) -> Self
[src]
fn get_mut(&mut self) -> &mut Self::Inner
[src]
fn into_inner(self) -> Self::Inner
[src]
fn load(&self, order: Ordering) -> Self::Inner
[src]
fn store(&self, v: Self::Inner, order: Ordering)
[src]
fn swap(&self, v: Self::Inner, order: Ordering) -> Self::Inner
[src]
fn compare_and_swap(
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
[src]
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
fn compare_exchange(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
fn compare_exchange_weak(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
impl AtomicImpl for AtomicI32
[src]
type Inner = i32
fn new(v: Self::Inner) -> Self
[src]
fn get_mut(&mut self) -> &mut Self::Inner
[src]
fn into_inner(self) -> Self::Inner
[src]
fn load(&self, order: Ordering) -> Self::Inner
[src]
fn store(&self, v: Self::Inner, order: Ordering)
[src]
fn swap(&self, v: Self::Inner, order: Ordering) -> Self::Inner
[src]
fn compare_and_swap(
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
[src]
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
fn compare_exchange(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
fn compare_exchange_weak(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
impl AtomicImpl for AtomicU64
[src]
type Inner = u64
fn new(v: Self::Inner) -> Self
[src]
fn get_mut(&mut self) -> &mut Self::Inner
[src]
fn into_inner(self) -> Self::Inner
[src]
fn load(&self, order: Ordering) -> Self::Inner
[src]
fn store(&self, v: Self::Inner, order: Ordering)
[src]
fn swap(&self, v: Self::Inner, order: Ordering) -> Self::Inner
[src]
fn compare_and_swap(
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
[src]
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
fn compare_exchange(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
fn compare_exchange_weak(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
impl AtomicImpl for AtomicI64
[src]
type Inner = i64
fn new(v: Self::Inner) -> Self
[src]
fn get_mut(&mut self) -> &mut Self::Inner
[src]
fn into_inner(self) -> Self::Inner
[src]
fn load(&self, order: Ordering) -> Self::Inner
[src]
fn store(&self, v: Self::Inner, order: Ordering)
[src]
fn swap(&self, v: Self::Inner, order: Ordering) -> Self::Inner
[src]
fn compare_and_swap(
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
[src]
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
fn compare_exchange(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
fn compare_exchange_weak(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
impl AtomicImpl for AtomicUsize
[src]
type Inner = usize
fn new(v: Self::Inner) -> Self
[src]
fn get_mut(&mut self) -> &mut Self::Inner
[src]
fn into_inner(self) -> Self::Inner
[src]
fn load(&self, order: Ordering) -> Self::Inner
[src]
fn store(&self, v: Self::Inner, order: Ordering)
[src]
fn swap(&self, v: Self::Inner, order: Ordering) -> Self::Inner
[src]
fn compare_and_swap(
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
[src]
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
fn compare_exchange(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
fn compare_exchange_weak(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
impl AtomicImpl for AtomicIsize
[src]
type Inner = isize
fn new(v: Self::Inner) -> Self
[src]
fn get_mut(&mut self) -> &mut Self::Inner
[src]
fn into_inner(self) -> Self::Inner
[src]
fn load(&self, order: Ordering) -> Self::Inner
[src]
fn store(&self, v: Self::Inner, order: Ordering)
[src]
fn swap(&self, v: Self::Inner, order: Ordering) -> Self::Inner
[src]
fn compare_and_swap(
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
[src]
&self,
current: Self::Inner,
new: Self::Inner,
order: Ordering
) -> Self::Inner
fn compare_exchange(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
fn compare_exchange_weak(
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>
[src]
&self,
current: Self::Inner,
new: Self::Inner,
success: Ordering,
failure: Ordering
) -> Result<Self::Inner, Self::Inner>