pub enum Rmw {
Add,
Sub,
And,
Nand,
Or,
Xor,
}Expand description
What a read modify write does to the value it read.
The six gcc has, which is every operation either family names. What a machine has a single instruction for is not decided here: the back end reads this and either finds an instruction or writes the loop around a compare and exchange that stands in for one.
Variants§
Add
Addition, which is lock xadd on this machine.
Sub
Subtraction, which is the same instruction over the negated operand.
And
Bitwise and.
Nand
Bitwise and with every bit of the answer flipped, which is the one of the six that is two operations rather than one and the one no machine here has anything for.
Or
Bitwise or.
Xor
Bitwise exclusive or.
Trait Implementations§
impl Copy for Rmw
impl Eq for Rmw
impl StructuralPartialEq for Rmw
Auto Trait Implementations§
impl Freeze for Rmw
impl RefUnwindSafe for Rmw
impl Send for Rmw
impl Sync for Rmw
impl Unpin for Rmw
impl UnsafeUnpin for Rmw
impl UnwindSafe for Rmw
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