st`], [`Acquire`] or [`Relaxed`]. # Panics Panics if `fetch_order` is [`Release`], [`AcqRel`]. # Considerations This method is not magic; it is not provided by the hardware. It is implemented in terms of [`compare_exchange_weak`](Self::compare_exchange_weak), and suffers from the same drawbacks. In particular, this method will not circumvent the [ABA Problem]. [ABA Problem]: https://en.wikipedia.org/wiki/ABA_problem # Examples ``` use portable_atomic::{AtomicU16, Ordering}; let x = AtomicU16::new(7); assert_eq!(x.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |_| None), Err(7)); assert_eq!(x.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |x| Some(x + 1)), Ok(7)); assert_eq!(x.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |x| Some(x + 1)), Ok(8)); assert_eq!(x.load(Ordering::SeqCst), 9); ```