pub trait Radium {
type Item;
Show 17 methods
// Required methods
fn new(value: Self::Item) -> Self;
fn fence(order: Ordering);
fn get_mut(&mut self) -> &mut Self::Item;
fn into_inner(self) -> Self::Item;
fn load(&self, order: Ordering) -> Self::Item;
fn store(&self, value: Self::Item, order: Ordering);
fn swap(&self, value: Self::Item, order: Ordering) -> Self::Item;
fn compare_and_swap(
&self,
current: Self::Item,
new: Self::Item,
order: Ordering
) -> Self::Item;
fn compare_exchange(
&self,
current: Self::Item,
new: Self::Item,
success: Ordering,
failure: Ordering
) -> Result<Self::Item, Self::Item>;
fn compare_exchange_weak(
&self,
current: Self::Item,
new: Self::Item,
success: Ordering,
failure: Ordering
) -> Result<Self::Item, Self::Item>;
fn fetch_and(&self, value: Self::Item, order: Ordering) -> Self::Item
where Self::Item: BitOps;
fn fetch_nand(&self, value: Self::Item, order: Ordering) -> Self::Item
where Self::Item: BitOps;
fn fetch_or(&self, value: Self::Item, order: Ordering) -> Self::Item
where Self::Item: BitOps;
fn fetch_xor(&self, value: Self::Item, order: Ordering) -> Self::Item
where Self::Item: BitOps;
fn fetch_add(&self, value: Self::Item, order: Ordering) -> Self::Item
where Self::Item: NumericOps;
fn fetch_sub(&self, value: Self::Item, order: Ordering) -> Self::Item
where Self::Item: NumericOps;
fn fetch_update<F>(
&self,
set_order: Ordering,
fetch_order: Ordering,
f: F
) -> Result<Self::Item, Self::Item>
where F: FnMut(Self::Item) -> Option<Self::Item>;
}
Expand description
A maybe-atomic shared mutable fundamental type T
.
This trait is implemented by both the atomic wrapper type for T
, and by
Cell<T>
, providing a consistent interface for interacting with the two
types.
This trait provides methods predicated on marker traits for the underlying
fundamental. Only types which can be viewed as sequences of bits may use the
functions for bit-wise arithmetic, and only types which can be used as
integers may use the functions for numeric arithmetic. Use of these methods
on insufficient underlying types (for example, Radium::fetch_and
on an
atomic or cell-wrapped pointer) will cause a compiler error.
Required Associated Types§
Required Methods§
sourcefn get_mut(&mut self) -> &mut Self::Item
fn get_mut(&mut self) -> &mut Self::Item
Returns a mutable reference to the underlying value.
This is safe because the mutable reference to self
guarantees that no
other references exist to this value.
sourcefn into_inner(self) -> Self::Item
fn into_inner(self) -> Self::Item
Consumes the wrapper and returns the contained value.
This is safe as passing by value ensures no other references exist.
sourcefn load(&self, order: Ordering) -> Self::Item
fn load(&self, order: Ordering) -> Self::Item
Load a value from this object.
Ordering values are ignored by non-atomic types.
See also: AtomicUsize::load
.
sourcefn store(&self, value: Self::Item, order: Ordering)
fn store(&self, value: Self::Item, order: Ordering)
Store a value in this object.
Ordering arguments are ignored by non-atomic types.
See also: AtomicUsize::store
.
sourcefn swap(&self, value: Self::Item, order: Ordering) -> Self::Item
fn swap(&self, value: Self::Item, order: Ordering) -> Self::Item
Swap with the value stored in this object.
Ordering arguments are ignored by non-atomic types.
See also: AtomicUsize::swap
.
sourcefn compare_and_swap(
&self,
current: Self::Item,
new: Self::Item,
order: Ordering
) -> Self::Item
fn compare_and_swap( &self, current: Self::Item, new: Self::Item, order: Ordering ) -> Self::Item
compare_exchange
or compare_exchange_weak
insteadStores a value into this object if the currently-stored value is the
same as the current
value.
The return value is always the previously-stored value. If it is equal to
current
, then the value was updated with new
.
Ordering arguments are ignored by non-atomic types.
See also: AtomicUsize::compare_and_swap
.
sourcefn compare_exchange(
&self,
current: Self::Item,
new: Self::Item,
success: Ordering,
failure: Ordering
) -> Result<Self::Item, Self::Item>
fn compare_exchange( &self, current: Self::Item, new: Self::Item, success: Ordering, failure: Ordering ) -> Result<Self::Item, Self::Item>
Stores a value into this object if the currently-stored value is the
same as the current
value.
The return value is a Result
indicating whether the new value was
written, and containing the previously-stored value. On success, this
value is guaranteed to be equal to current
.
Ordering arguments are ignored by non-atomic types.
See also: AtomicUsize::compare_exchange
.
sourcefn compare_exchange_weak(
&self,
current: Self::Item,
new: Self::Item,
success: Ordering,
failure: Ordering
) -> Result<Self::Item, Self::Item>
fn compare_exchange_weak( &self, current: Self::Item, new: Self::Item, success: Ordering, failure: Ordering ) -> Result<Self::Item, Self::Item>
Stores a value into this object if the currently-stored value is the
same as the current
value.
Unlike compare_exchange
, this function is allowed to spuriously fail
even when the comparison succeeds, which can result in more efficient
code on some platforms. The return value is a Result
indicating
whether the new value was written, and containing the previously-stored
value.
Ordering arguments are ignored by non-atomic types.
See also: AtomicUsize::compare_exchange_weak
.
sourcefn fetch_and(&self, value: Self::Item, order: Ordering) -> Self::Itemwhere
Self::Item: BitOps,
fn fetch_and(&self, value: Self::Item, order: Ordering) -> Self::Itemwhere Self::Item: BitOps,
Performs a bitwise “and” on the currently-stored value and the argument
value
, and stores the result in self
.
Returns the previously-stored value.
Ordering arguments are ignored by non-atomic types.
See also: AtomicUsize::fetch_and
.
sourcefn fetch_nand(&self, value: Self::Item, order: Ordering) -> Self::Itemwhere
Self::Item: BitOps,
fn fetch_nand(&self, value: Self::Item, order: Ordering) -> Self::Itemwhere Self::Item: BitOps,
Performs a bitwise “nand” on the currently-stored value and the argument
value
, and stores the result in self
.
Returns the previously-stored value.
Ordering arguments are ignored by non-atomic types.
See also: AtomicUsize::fetch_nand
.
sourcefn fetch_or(&self, value: Self::Item, order: Ordering) -> Self::Itemwhere
Self::Item: BitOps,
fn fetch_or(&self, value: Self::Item, order: Ordering) -> Self::Itemwhere Self::Item: BitOps,
Performs a bitwise “or” on the currently-stored value and the argument
value
, and stores the result in self
.
Returns the previously-stored value.
Ordering arguments are ignored by non-atomic types.
See also: AtomicUsize::fetch_or
.
sourcefn fetch_xor(&self, value: Self::Item, order: Ordering) -> Self::Itemwhere
Self::Item: BitOps,
fn fetch_xor(&self, value: Self::Item, order: Ordering) -> Self::Itemwhere Self::Item: BitOps,
Performs a bitwise “xor” on the currently-stored value and the argument
value
, and stores the result in self
.
Returns the previously-stored value.
Ordering arguments are ignored by non-atomic types.
See also: AtomicUsize::fetch_xor
.
sourcefn fetch_add(&self, value: Self::Item, order: Ordering) -> Self::Itemwhere
Self::Item: NumericOps,
fn fetch_add(&self, value: Self::Item, order: Ordering) -> Self::Itemwhere Self::Item: NumericOps,
Adds value
to the currently-stored value, wrapping on overflow, and
stores the result in self
.
Returns the previously-stored value.
Ordering arguments are ignored by non-atomic types.
See also: AtomicUsize::fetch_add
.
sourcefn fetch_sub(&self, value: Self::Item, order: Ordering) -> Self::Itemwhere
Self::Item: NumericOps,
fn fetch_sub(&self, value: Self::Item, order: Ordering) -> Self::Itemwhere Self::Item: NumericOps,
Subtracts value
from the currently-stored value, wrapping on
underflow, and stores the result in self
.
Returns the previously-stored value.
Ordering arguments are ignored by non-atomic types.
See also: AtomicUsize::fetch_sub
.
sourcefn fetch_update<F>(
&self,
set_order: Ordering,
fetch_order: Ordering,
f: F
) -> Result<Self::Item, Self::Item>where
F: FnMut(Self::Item) -> Option<Self::Item>,
fn fetch_update<F>( &self, set_order: Ordering, fetch_order: Ordering, f: F ) -> Result<Self::Item, Self::Item>where F: FnMut(Self::Item) -> Option<Self::Item>,
Fetches the value, and applies a function to it that returns an optional new value.
Note: This may call the function multiple times if the value has been
changed from other threads in the meantime, as long as the function
returns Some(_)
, but the function will have been applied only once to
the stored value.
Returns a Result
of Ok(previous_value)
if the function returned
Some(_)
, else Err(previous_value)
.
Ordering arguments are ignored by non-atomic types.
See also: AtomicUsize::fetch_update
.
Implementations on Foreign Types§
source§impl Radium for AtomicI64
impl Radium for AtomicI64
type Item = i64
fn new(value: i64) -> Self
fn fence(order: Ordering)
fn get_mut(&mut self) -> &mut i64
fn into_inner(self) -> i64
fn load(&self, order: Ordering) -> i64
fn store(&self, value: i64, order: Ordering)
fn swap(&self, value: i64, order: Ordering) -> i64
source§fn compare_and_swap(&self, current: i64, new: i64, order: Ordering) -> i64
fn compare_and_swap(&self, current: i64, new: i64, order: Ordering) -> i64
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: i64, new: i64, success: Ordering, failure: Ordering ) -> Result<i64, i64>
fn compare_exchange_weak( &self, current: i64, new: i64, success: Ordering, failure: Ordering ) -> Result<i64, i64>
fn fetch_update<F>( &self, set_order: Ordering, fetch_order: Ordering, f: F ) -> Result<i64, i64>where F: FnMut(i64) -> Option<i64>,
fn fetch_and(&self, value: i64, order: Ordering) -> i64
fn fetch_nand(&self, value: i64, order: Ordering) -> i64
fn fetch_or(&self, value: i64, order: Ordering) -> i64
fn fetch_xor(&self, value: i64, order: Ordering) -> i64
fn fetch_add(&self, value: i64, order: Ordering) -> i64
fn fetch_sub(&self, value: i64, order: Ordering) -> i64
source§impl Radium for AtomicI8
impl Radium for AtomicI8
type Item = i8
fn new(value: i8) -> Self
fn fence(order: Ordering)
fn get_mut(&mut self) -> &mut i8
fn into_inner(self) -> i8
fn load(&self, order: Ordering) -> i8
fn store(&self, value: i8, order: Ordering)
fn swap(&self, value: i8, order: Ordering) -> i8
source§fn compare_and_swap(&self, current: i8, new: i8, order: Ordering) -> i8
fn compare_and_swap(&self, current: i8, new: i8, order: Ordering) -> i8
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: i8, new: i8, success: Ordering, failure: Ordering ) -> Result<i8, i8>
fn compare_exchange_weak( &self, current: i8, new: i8, success: Ordering, failure: Ordering ) -> Result<i8, i8>
fn fetch_update<F>( &self, set_order: Ordering, fetch_order: Ordering, f: F ) -> Result<i8, i8>where F: FnMut(i8) -> Option<i8>,
fn fetch_and(&self, value: i8, order: Ordering) -> i8
fn fetch_nand(&self, value: i8, order: Ordering) -> i8
fn fetch_or(&self, value: i8, order: Ordering) -> i8
fn fetch_xor(&self, value: i8, order: Ordering) -> i8
fn fetch_add(&self, value: i8, order: Ordering) -> i8
fn fetch_sub(&self, value: i8, order: Ordering) -> i8
source§impl Radium for Cell<usize>
impl Radium for Cell<usize>
type Item = usize
fn new(value: usize) -> Self
fn fence(_: Ordering)
fn get_mut(&mut self) -> &mut usize
fn into_inner(self) -> usize
fn load(&self, _: Ordering) -> usize
fn store(&self, value: usize, _: Ordering)
fn swap(&self, value: usize, _: Ordering) -> usize
source§fn compare_and_swap(&self, current: usize, new: usize, _: Ordering) -> usize
fn compare_and_swap(&self, current: usize, new: usize, _: Ordering) -> usize
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: usize, new: usize, _: Ordering, _: Ordering ) -> Result<usize, usize>
fn compare_exchange_weak( &self, current: usize, new: usize, success: Ordering, failure: Ordering ) -> Result<usize, usize>
fn fetch_update<F>( &self, _: Ordering, _: Ordering, f: F ) -> Result<usize, usize>where F: FnMut(usize) -> Option<usize>,
fn fetch_and(&self, value: usize, _: Ordering) -> usize
fn fetch_nand(&self, value: usize, _: Ordering) -> usize
fn fetch_or(&self, value: usize, _: Ordering) -> usize
fn fetch_xor(&self, value: usize, _: Ordering) -> usize
fn fetch_add(&self, value: usize, _: Ordering) -> usize
fn fetch_sub(&self, value: usize, _: Ordering) -> usize
source§impl Radium for Cell<i16>
impl Radium for Cell<i16>
type Item = i16
fn new(value: i16) -> Self
fn fence(_: Ordering)
fn get_mut(&mut self) -> &mut i16
fn into_inner(self) -> i16
fn load(&self, _: Ordering) -> i16
fn store(&self, value: i16, _: Ordering)
fn swap(&self, value: i16, _: Ordering) -> i16
source§fn compare_and_swap(&self, current: i16, new: i16, _: Ordering) -> i16
fn compare_and_swap(&self, current: i16, new: i16, _: Ordering) -> i16
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: i16, new: i16, _: Ordering, _: Ordering ) -> Result<i16, i16>
fn compare_exchange_weak( &self, current: i16, new: i16, success: Ordering, failure: Ordering ) -> Result<i16, i16>
fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<i16, i16>where F: FnMut(i16) -> Option<i16>,
fn fetch_and(&self, value: i16, _: Ordering) -> i16
fn fetch_nand(&self, value: i16, _: Ordering) -> i16
fn fetch_or(&self, value: i16, _: Ordering) -> i16
fn fetch_xor(&self, value: i16, _: Ordering) -> i16
fn fetch_add(&self, value: i16, _: Ordering) -> i16
fn fetch_sub(&self, value: i16, _: Ordering) -> i16
source§impl Radium for AtomicU8
impl Radium for AtomicU8
type Item = u8
fn new(value: u8) -> Self
fn fence(order: Ordering)
fn get_mut(&mut self) -> &mut u8
fn into_inner(self) -> u8
fn load(&self, order: Ordering) -> u8
fn store(&self, value: u8, order: Ordering)
fn swap(&self, value: u8, order: Ordering) -> u8
source§fn compare_and_swap(&self, current: u8, new: u8, order: Ordering) -> u8
fn compare_and_swap(&self, current: u8, new: u8, order: Ordering) -> u8
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: u8, new: u8, success: Ordering, failure: Ordering ) -> Result<u8, u8>
fn compare_exchange_weak( &self, current: u8, new: u8, success: Ordering, failure: Ordering ) -> Result<u8, u8>
fn fetch_update<F>( &self, set_order: Ordering, fetch_order: Ordering, f: F ) -> Result<u8, u8>where F: FnMut(u8) -> Option<u8>,
fn fetch_and(&self, value: u8, order: Ordering) -> u8
fn fetch_nand(&self, value: u8, order: Ordering) -> u8
fn fetch_or(&self, value: u8, order: Ordering) -> u8
fn fetch_xor(&self, value: u8, order: Ordering) -> u8
fn fetch_add(&self, value: u8, order: Ordering) -> u8
fn fetch_sub(&self, value: u8, order: Ordering) -> u8
source§impl Radium for AtomicUsize
impl Radium for AtomicUsize
type Item = usize
fn new(value: usize) -> Self
fn fence(order: Ordering)
fn get_mut(&mut self) -> &mut usize
fn into_inner(self) -> usize
fn load(&self, order: Ordering) -> usize
fn store(&self, value: usize, order: Ordering)
fn swap(&self, value: usize, order: Ordering) -> usize
source§fn compare_and_swap(&self, current: usize, new: usize, order: Ordering) -> usize
fn compare_and_swap(&self, current: usize, new: usize, order: Ordering) -> usize
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: usize, new: usize, success: Ordering, failure: Ordering ) -> Result<usize, usize>
fn compare_exchange_weak( &self, current: usize, new: usize, success: Ordering, failure: Ordering ) -> Result<usize, usize>
fn fetch_update<F>( &self, set_order: Ordering, fetch_order: Ordering, f: F ) -> Result<usize, usize>where F: FnMut(usize) -> Option<usize>,
fn fetch_and(&self, value: usize, order: Ordering) -> usize
fn fetch_nand(&self, value: usize, order: Ordering) -> usize
fn fetch_or(&self, value: usize, order: Ordering) -> usize
fn fetch_xor(&self, value: usize, order: Ordering) -> usize
fn fetch_add(&self, value: usize, order: Ordering) -> usize
fn fetch_sub(&self, value: usize, order: Ordering) -> usize
source§impl Radium for AtomicI32
impl Radium for AtomicI32
type Item = i32
fn new(value: i32) -> Self
fn fence(order: Ordering)
fn get_mut(&mut self) -> &mut i32
fn into_inner(self) -> i32
fn load(&self, order: Ordering) -> i32
fn store(&self, value: i32, order: Ordering)
fn swap(&self, value: i32, order: Ordering) -> i32
source§fn compare_and_swap(&self, current: i32, new: i32, order: Ordering) -> i32
fn compare_and_swap(&self, current: i32, new: i32, order: Ordering) -> i32
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: i32, new: i32, success: Ordering, failure: Ordering ) -> Result<i32, i32>
fn compare_exchange_weak( &self, current: i32, new: i32, success: Ordering, failure: Ordering ) -> Result<i32, i32>
fn fetch_update<F>( &self, set_order: Ordering, fetch_order: Ordering, f: F ) -> Result<i32, i32>where F: FnMut(i32) -> Option<i32>,
fn fetch_and(&self, value: i32, order: Ordering) -> i32
fn fetch_nand(&self, value: i32, order: Ordering) -> i32
fn fetch_or(&self, value: i32, order: Ordering) -> i32
fn fetch_xor(&self, value: i32, order: Ordering) -> i32
fn fetch_add(&self, value: i32, order: Ordering) -> i32
fn fetch_sub(&self, value: i32, order: Ordering) -> i32
source§impl Radium for AtomicIsize
impl Radium for AtomicIsize
type Item = isize
fn new(value: isize) -> Self
fn fence(order: Ordering)
fn get_mut(&mut self) -> &mut isize
fn into_inner(self) -> isize
fn load(&self, order: Ordering) -> isize
fn store(&self, value: isize, order: Ordering)
fn swap(&self, value: isize, order: Ordering) -> isize
source§fn compare_and_swap(&self, current: isize, new: isize, order: Ordering) -> isize
fn compare_and_swap(&self, current: isize, new: isize, order: Ordering) -> isize
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: isize, new: isize, success: Ordering, failure: Ordering ) -> Result<isize, isize>
fn compare_exchange_weak( &self, current: isize, new: isize, success: Ordering, failure: Ordering ) -> Result<isize, isize>
fn fetch_update<F>( &self, set_order: Ordering, fetch_order: Ordering, f: F ) -> Result<isize, isize>where F: FnMut(isize) -> Option<isize>,
fn fetch_and(&self, value: isize, order: Ordering) -> isize
fn fetch_nand(&self, value: isize, order: Ordering) -> isize
fn fetch_or(&self, value: isize, order: Ordering) -> isize
fn fetch_xor(&self, value: isize, order: Ordering) -> isize
fn fetch_add(&self, value: isize, order: Ordering) -> isize
fn fetch_sub(&self, value: isize, order: Ordering) -> isize
source§impl Radium for Cell<u8>
impl Radium for Cell<u8>
type Item = u8
fn new(value: u8) -> Self
fn fence(_: Ordering)
fn get_mut(&mut self) -> &mut u8
fn into_inner(self) -> u8
fn load(&self, _: Ordering) -> u8
fn store(&self, value: u8, _: Ordering)
fn swap(&self, value: u8, _: Ordering) -> u8
source§fn compare_and_swap(&self, current: u8, new: u8, _: Ordering) -> u8
fn compare_and_swap(&self, current: u8, new: u8, _: Ordering) -> u8
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: u8, new: u8, _: Ordering, _: Ordering ) -> Result<u8, u8>
fn compare_exchange_weak( &self, current: u8, new: u8, success: Ordering, failure: Ordering ) -> Result<u8, u8>
fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<u8, u8>where F: FnMut(u8) -> Option<u8>,
fn fetch_and(&self, value: u8, _: Ordering) -> u8
fn fetch_nand(&self, value: u8, _: Ordering) -> u8
fn fetch_or(&self, value: u8, _: Ordering) -> u8
fn fetch_xor(&self, value: u8, _: Ordering) -> u8
fn fetch_add(&self, value: u8, _: Ordering) -> u8
fn fetch_sub(&self, value: u8, _: Ordering) -> u8
source§impl Radium for AtomicI16
impl Radium for AtomicI16
type Item = i16
fn new(value: i16) -> Self
fn fence(order: Ordering)
fn get_mut(&mut self) -> &mut i16
fn into_inner(self) -> i16
fn load(&self, order: Ordering) -> i16
fn store(&self, value: i16, order: Ordering)
fn swap(&self, value: i16, order: Ordering) -> i16
source§fn compare_and_swap(&self, current: i16, new: i16, order: Ordering) -> i16
fn compare_and_swap(&self, current: i16, new: i16, order: Ordering) -> i16
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: i16, new: i16, success: Ordering, failure: Ordering ) -> Result<i16, i16>
fn compare_exchange_weak( &self, current: i16, new: i16, success: Ordering, failure: Ordering ) -> Result<i16, i16>
fn fetch_update<F>( &self, set_order: Ordering, fetch_order: Ordering, f: F ) -> Result<i16, i16>where F: FnMut(i16) -> Option<i16>,
fn fetch_and(&self, value: i16, order: Ordering) -> i16
fn fetch_nand(&self, value: i16, order: Ordering) -> i16
fn fetch_or(&self, value: i16, order: Ordering) -> i16
fn fetch_xor(&self, value: i16, order: Ordering) -> i16
fn fetch_add(&self, value: i16, order: Ordering) -> i16
fn fetch_sub(&self, value: i16, order: Ordering) -> i16
source§impl Radium for Cell<u64>
impl Radium for Cell<u64>
type Item = u64
fn new(value: u64) -> Self
fn fence(_: Ordering)
fn get_mut(&mut self) -> &mut u64
fn into_inner(self) -> u64
fn load(&self, _: Ordering) -> u64
fn store(&self, value: u64, _: Ordering)
fn swap(&self, value: u64, _: Ordering) -> u64
source§fn compare_and_swap(&self, current: u64, new: u64, _: Ordering) -> u64
fn compare_and_swap(&self, current: u64, new: u64, _: Ordering) -> u64
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: u64, new: u64, _: Ordering, _: Ordering ) -> Result<u64, u64>
fn compare_exchange_weak( &self, current: u64, new: u64, success: Ordering, failure: Ordering ) -> Result<u64, u64>
fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<u64, u64>where F: FnMut(u64) -> Option<u64>,
fn fetch_and(&self, value: u64, _: Ordering) -> u64
fn fetch_nand(&self, value: u64, _: Ordering) -> u64
fn fetch_or(&self, value: u64, _: Ordering) -> u64
fn fetch_xor(&self, value: u64, _: Ordering) -> u64
fn fetch_add(&self, value: u64, _: Ordering) -> u64
fn fetch_sub(&self, value: u64, _: Ordering) -> u64
source§impl Radium for Cell<bool>
impl Radium for Cell<bool>
type Item = bool
fn new(value: bool) -> Self
fn fence(_: Ordering)
fn get_mut(&mut self) -> &mut bool
fn into_inner(self) -> bool
fn load(&self, _: Ordering) -> bool
fn store(&self, value: bool, _: Ordering)
fn swap(&self, value: bool, _: Ordering) -> bool
source§fn compare_and_swap(&self, current: bool, new: bool, _: Ordering) -> bool
fn compare_and_swap(&self, current: bool, new: bool, _: Ordering) -> bool
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: bool, new: bool, _: Ordering, _: Ordering ) -> Result<bool, bool>
fn compare_exchange_weak( &self, current: bool, new: bool, success: Ordering, failure: Ordering ) -> Result<bool, bool>
fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<bool, bool>where F: FnMut(bool) -> Option<bool>,
fn fetch_and(&self, value: bool, _: Ordering) -> bool
fn fetch_nand(&self, value: bool, _: Ordering) -> bool
fn fetch_or(&self, value: bool, _: Ordering) -> bool
fn fetch_xor(&self, value: bool, _: Ordering) -> bool
source§impl<T> Radium for AtomicPtr<T>
impl<T> Radium for AtomicPtr<T>
type Item = *mut T
fn new(value: *mut T) -> Self
fn fence(order: Ordering)
fn get_mut(&mut self) -> &mut *mut T
fn into_inner(self) -> *mut T
fn load(&self, order: Ordering) -> *mut T
fn store(&self, value: *mut T, order: Ordering)
fn swap(&self, value: *mut T, order: Ordering) -> *mut T
source§fn compare_and_swap(
&self,
current: *mut T,
new: *mut T,
order: Ordering
) -> *mut T
fn compare_and_swap( &self, current: *mut T, new: *mut T, order: Ordering ) -> *mut T
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: *mut T, new: *mut T, success: Ordering, failure: Ordering ) -> Result<*mut T, *mut T>
fn compare_exchange_weak( &self, current: *mut T, new: *mut T, success: Ordering, failure: Ordering ) -> Result<*mut T, *mut T>
fn fetch_update<F>( &self, set_order: Ordering, fetch_order: Ordering, f: F ) -> Result<*mut T, *mut T>where F: FnMut(*mut T) -> Option<*mut T>,
source§impl Radium for Cell<u16>
impl Radium for Cell<u16>
type Item = u16
fn new(value: u16) -> Self
fn fence(_: Ordering)
fn get_mut(&mut self) -> &mut u16
fn into_inner(self) -> u16
fn load(&self, _: Ordering) -> u16
fn store(&self, value: u16, _: Ordering)
fn swap(&self, value: u16, _: Ordering) -> u16
source§fn compare_and_swap(&self, current: u16, new: u16, _: Ordering) -> u16
fn compare_and_swap(&self, current: u16, new: u16, _: Ordering) -> u16
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: u16, new: u16, _: Ordering, _: Ordering ) -> Result<u16, u16>
fn compare_exchange_weak( &self, current: u16, new: u16, success: Ordering, failure: Ordering ) -> Result<u16, u16>
fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<u16, u16>where F: FnMut(u16) -> Option<u16>,
fn fetch_and(&self, value: u16, _: Ordering) -> u16
fn fetch_nand(&self, value: u16, _: Ordering) -> u16
fn fetch_or(&self, value: u16, _: Ordering) -> u16
fn fetch_xor(&self, value: u16, _: Ordering) -> u16
fn fetch_add(&self, value: u16, _: Ordering) -> u16
fn fetch_sub(&self, value: u16, _: Ordering) -> u16
source§impl<T> Radium for Cell<*mut T>
impl<T> Radium for Cell<*mut T>
type Item = *mut T
fn new(value: *mut T) -> Self
fn fence(_: Ordering)
fn get_mut(&mut self) -> &mut *mut T
fn into_inner(self) -> *mut T
fn load(&self, _: Ordering) -> *mut T
fn store(&self, value: *mut T, _: Ordering)
fn swap(&self, value: *mut T, _: Ordering) -> *mut T
source§fn compare_and_swap(&self, current: *mut T, new: *mut T, _: Ordering) -> *mut T
fn compare_and_swap(&self, current: *mut T, new: *mut T, _: Ordering) -> *mut T
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: *mut T, new: *mut T, _: Ordering, _: Ordering ) -> Result<*mut T, *mut T>
fn compare_exchange_weak( &self, current: *mut T, new: *mut T, success: Ordering, failure: Ordering ) -> Result<*mut T, *mut T>
fn fetch_update<F>( &self, _: Ordering, _: Ordering, f: F ) -> Result<*mut T, *mut T>where F: FnMut(*mut T) -> Option<*mut T>,
source§impl Radium for Cell<i64>
impl Radium for Cell<i64>
type Item = i64
fn new(value: i64) -> Self
fn fence(_: Ordering)
fn get_mut(&mut self) -> &mut i64
fn into_inner(self) -> i64
fn load(&self, _: Ordering) -> i64
fn store(&self, value: i64, _: Ordering)
fn swap(&self, value: i64, _: Ordering) -> i64
source§fn compare_and_swap(&self, current: i64, new: i64, _: Ordering) -> i64
fn compare_and_swap(&self, current: i64, new: i64, _: Ordering) -> i64
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: i64, new: i64, _: Ordering, _: Ordering ) -> Result<i64, i64>
fn compare_exchange_weak( &self, current: i64, new: i64, success: Ordering, failure: Ordering ) -> Result<i64, i64>
fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<i64, i64>where F: FnMut(i64) -> Option<i64>,
fn fetch_and(&self, value: i64, _: Ordering) -> i64
fn fetch_nand(&self, value: i64, _: Ordering) -> i64
fn fetch_or(&self, value: i64, _: Ordering) -> i64
fn fetch_xor(&self, value: i64, _: Ordering) -> i64
fn fetch_add(&self, value: i64, _: Ordering) -> i64
fn fetch_sub(&self, value: i64, _: Ordering) -> i64
source§impl Radium for AtomicU64
impl Radium for AtomicU64
type Item = u64
fn new(value: u64) -> Self
fn fence(order: Ordering)
fn get_mut(&mut self) -> &mut u64
fn into_inner(self) -> u64
fn load(&self, order: Ordering) -> u64
fn store(&self, value: u64, order: Ordering)
fn swap(&self, value: u64, order: Ordering) -> u64
source§fn compare_and_swap(&self, current: u64, new: u64, order: Ordering) -> u64
fn compare_and_swap(&self, current: u64, new: u64, order: Ordering) -> u64
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: u64, new: u64, success: Ordering, failure: Ordering ) -> Result<u64, u64>
fn compare_exchange_weak( &self, current: u64, new: u64, success: Ordering, failure: Ordering ) -> Result<u64, u64>
fn fetch_update<F>( &self, set_order: Ordering, fetch_order: Ordering, f: F ) -> Result<u64, u64>where F: FnMut(u64) -> Option<u64>,
fn fetch_and(&self, value: u64, order: Ordering) -> u64
fn fetch_nand(&self, value: u64, order: Ordering) -> u64
fn fetch_or(&self, value: u64, order: Ordering) -> u64
fn fetch_xor(&self, value: u64, order: Ordering) -> u64
fn fetch_add(&self, value: u64, order: Ordering) -> u64
fn fetch_sub(&self, value: u64, order: Ordering) -> u64
source§impl Radium for Cell<u32>
impl Radium for Cell<u32>
type Item = u32
fn new(value: u32) -> Self
fn fence(_: Ordering)
fn get_mut(&mut self) -> &mut u32
fn into_inner(self) -> u32
fn load(&self, _: Ordering) -> u32
fn store(&self, value: u32, _: Ordering)
fn swap(&self, value: u32, _: Ordering) -> u32
source§fn compare_and_swap(&self, current: u32, new: u32, _: Ordering) -> u32
fn compare_and_swap(&self, current: u32, new: u32, _: Ordering) -> u32
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: u32, new: u32, _: Ordering, _: Ordering ) -> Result<u32, u32>
fn compare_exchange_weak( &self, current: u32, new: u32, success: Ordering, failure: Ordering ) -> Result<u32, u32>
fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<u32, u32>where F: FnMut(u32) -> Option<u32>,
fn fetch_and(&self, value: u32, _: Ordering) -> u32
fn fetch_nand(&self, value: u32, _: Ordering) -> u32
fn fetch_or(&self, value: u32, _: Ordering) -> u32
fn fetch_xor(&self, value: u32, _: Ordering) -> u32
fn fetch_add(&self, value: u32, _: Ordering) -> u32
fn fetch_sub(&self, value: u32, _: Ordering) -> u32
source§impl Radium for AtomicU32
impl Radium for AtomicU32
type Item = u32
fn new(value: u32) -> Self
fn fence(order: Ordering)
fn get_mut(&mut self) -> &mut u32
fn into_inner(self) -> u32
fn load(&self, order: Ordering) -> u32
fn store(&self, value: u32, order: Ordering)
fn swap(&self, value: u32, order: Ordering) -> u32
source§fn compare_and_swap(&self, current: u32, new: u32, order: Ordering) -> u32
fn compare_and_swap(&self, current: u32, new: u32, order: Ordering) -> u32
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: u32, new: u32, success: Ordering, failure: Ordering ) -> Result<u32, u32>
fn compare_exchange_weak( &self, current: u32, new: u32, success: Ordering, failure: Ordering ) -> Result<u32, u32>
fn fetch_update<F>( &self, set_order: Ordering, fetch_order: Ordering, f: F ) -> Result<u32, u32>where F: FnMut(u32) -> Option<u32>,
fn fetch_and(&self, value: u32, order: Ordering) -> u32
fn fetch_nand(&self, value: u32, order: Ordering) -> u32
fn fetch_or(&self, value: u32, order: Ordering) -> u32
fn fetch_xor(&self, value: u32, order: Ordering) -> u32
fn fetch_add(&self, value: u32, order: Ordering) -> u32
fn fetch_sub(&self, value: u32, order: Ordering) -> u32
source§impl Radium for Cell<isize>
impl Radium for Cell<isize>
type Item = isize
fn new(value: isize) -> Self
fn fence(_: Ordering)
fn get_mut(&mut self) -> &mut isize
fn into_inner(self) -> isize
fn load(&self, _: Ordering) -> isize
fn store(&self, value: isize, _: Ordering)
fn swap(&self, value: isize, _: Ordering) -> isize
source§fn compare_and_swap(&self, current: isize, new: isize, _: Ordering) -> isize
fn compare_and_swap(&self, current: isize, new: isize, _: Ordering) -> isize
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: isize, new: isize, _: Ordering, _: Ordering ) -> Result<isize, isize>
fn compare_exchange_weak( &self, current: isize, new: isize, success: Ordering, failure: Ordering ) -> Result<isize, isize>
fn fetch_update<F>( &self, _: Ordering, _: Ordering, f: F ) -> Result<isize, isize>where F: FnMut(isize) -> Option<isize>,
fn fetch_and(&self, value: isize, _: Ordering) -> isize
fn fetch_nand(&self, value: isize, _: Ordering) -> isize
fn fetch_or(&self, value: isize, _: Ordering) -> isize
fn fetch_xor(&self, value: isize, _: Ordering) -> isize
fn fetch_add(&self, value: isize, _: Ordering) -> isize
fn fetch_sub(&self, value: isize, _: Ordering) -> isize
source§impl Radium for Cell<i8>
impl Radium for Cell<i8>
type Item = i8
fn new(value: i8) -> Self
fn fence(_: Ordering)
fn get_mut(&mut self) -> &mut i8
fn into_inner(self) -> i8
fn load(&self, _: Ordering) -> i8
fn store(&self, value: i8, _: Ordering)
fn swap(&self, value: i8, _: Ordering) -> i8
source§fn compare_and_swap(&self, current: i8, new: i8, _: Ordering) -> i8
fn compare_and_swap(&self, current: i8, new: i8, _: Ordering) -> i8
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: i8, new: i8, _: Ordering, _: Ordering ) -> Result<i8, i8>
fn compare_exchange_weak( &self, current: i8, new: i8, success: Ordering, failure: Ordering ) -> Result<i8, i8>
fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<i8, i8>where F: FnMut(i8) -> Option<i8>,
fn fetch_and(&self, value: i8, _: Ordering) -> i8
fn fetch_nand(&self, value: i8, _: Ordering) -> i8
fn fetch_or(&self, value: i8, _: Ordering) -> i8
fn fetch_xor(&self, value: i8, _: Ordering) -> i8
fn fetch_add(&self, value: i8, _: Ordering) -> i8
fn fetch_sub(&self, value: i8, _: Ordering) -> i8
source§impl Radium for AtomicU16
impl Radium for AtomicU16
type Item = u16
fn new(value: u16) -> Self
fn fence(order: Ordering)
fn get_mut(&mut self) -> &mut u16
fn into_inner(self) -> u16
fn load(&self, order: Ordering) -> u16
fn store(&self, value: u16, order: Ordering)
fn swap(&self, value: u16, order: Ordering) -> u16
source§fn compare_and_swap(&self, current: u16, new: u16, order: Ordering) -> u16
fn compare_and_swap(&self, current: u16, new: u16, order: Ordering) -> u16
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: u16, new: u16, success: Ordering, failure: Ordering ) -> Result<u16, u16>
fn compare_exchange_weak( &self, current: u16, new: u16, success: Ordering, failure: Ordering ) -> Result<u16, u16>
fn fetch_update<F>( &self, set_order: Ordering, fetch_order: Ordering, f: F ) -> Result<u16, u16>where F: FnMut(u16) -> Option<u16>,
fn fetch_and(&self, value: u16, order: Ordering) -> u16
fn fetch_nand(&self, value: u16, order: Ordering) -> u16
fn fetch_or(&self, value: u16, order: Ordering) -> u16
fn fetch_xor(&self, value: u16, order: Ordering) -> u16
fn fetch_add(&self, value: u16, order: Ordering) -> u16
fn fetch_sub(&self, value: u16, order: Ordering) -> u16
source§impl Radium for Cell<i32>
impl Radium for Cell<i32>
type Item = i32
fn new(value: i32) -> Self
fn fence(_: Ordering)
fn get_mut(&mut self) -> &mut i32
fn into_inner(self) -> i32
fn load(&self, _: Ordering) -> i32
fn store(&self, value: i32, _: Ordering)
fn swap(&self, value: i32, _: Ordering) -> i32
source§fn compare_and_swap(&self, current: i32, new: i32, _: Ordering) -> i32
fn compare_and_swap(&self, current: i32, new: i32, _: Ordering) -> i32
compare_exchange
or compare_exchange_weak
insteadfn compare_exchange( &self, current: i32, new: i32, _: Ordering, _: Ordering ) -> Result<i32, i32>
fn compare_exchange_weak( &self, current: i32, new: i32, success: Ordering, failure: Ordering ) -> Result<i32, i32>
fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<i32, i32>where F: FnMut(i32) -> Option<i32>,
fn fetch_and(&self, value: i32, _: Ordering) -> i32
fn fetch_nand(&self, value: i32, _: Ordering) -> i32
fn fetch_or(&self, value: i32, _: Ordering) -> i32
fn fetch_xor(&self, value: i32, _: Ordering) -> i32
fn fetch_add(&self, value: i32, _: Ordering) -> i32
fn fetch_sub(&self, value: i32, _: Ordering) -> i32
source§impl Radium for AtomicBool
impl Radium for AtomicBool
type Item = bool
fn new(value: bool) -> Self
fn fence(order: Ordering)
fn get_mut(&mut self) -> &mut bool
fn into_inner(self) -> bool
fn load(&self, order: Ordering) -> bool
fn store(&self, value: bool, order: Ordering)
fn swap(&self, value: bool, order: Ordering) -> bool
source§fn compare_and_swap(&self, current: bool, new: bool, order: Ordering) -> bool
fn compare_and_swap(&self, current: bool, new: bool, order: Ordering) -> bool
compare_exchange
or compare_exchange_weak
instead