pub struct Racy<'a, T: RacyStorage>(/* private fields */);Expand description
An opaque pointer to memory implementing the ECMAScript atomic memory model.
Implementations§
Source§impl<T: RacyStorage> Racy<'_, T>
impl<T: RacyStorage> Racy<'_, T>
Sourcepub fn compare_exchange(&self, current: T, new: T) -> Result<T, T>
pub fn compare_exchange(&self, current: T, new: T) -> Result<T, T>
Stores a value into the racy atomic integer if the current value is the
same as the current value.
The return value is a result indicating whether the new value was
written and containing the previous value. On success this value is
guaranteed to be equal to current.
Sourcepub fn load(&self, order: Ordering) -> T
pub fn load(&self, order: Ordering) -> T
Loads a value from the atomic integer.
load takes an Ordering argument which describes the memory
ordering of this operation. All ordering modes are possible.
Trait Implementations§
impl<'a, T: Copy + RacyStorage> Copy for Racy<'a, T>
impl<T: RacyStorage> Send for Racy<'_, T>
impl<T: RacyStorage> Sync for Racy<'_, T>
Auto Trait Implementations§
impl<'a, T> Freeze for Racy<'a, T>
impl<'a, T> !RefUnwindSafe for Racy<'a, T>
impl<'a, T> Unpin for Racy<'a, T>
impl<'a, T> !UnwindSafe for Racy<'a, T>
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