Feature gate: #![feature(atomic_try_update)]
This is a tracking issue for an infallible version of AtomicT::fetch_update as well as a new name for the existing fallible version.
When and if this gets stabilized, the existing fetch_update should be marked as a deprecated alias for try_update.
Public API
impl AtomicT {
// same as `fetch_update`
pub fn try_update(
&self,
set_order: Ordering,
fetch_order: Ordering,
f: impl FnMut(T) -> Option<T>,
) -> Result<T, T>;
pub fn update(
&self,
set_order: Ordering,
fetch_order: Ordering,
f: impl FnMut(T) -> T,
) -> T;
}
Steps / History
Unresolved Questions
Feature gate:
#![feature(atomic_try_update)]This is a tracking issue for an infallible version of
AtomicT::fetch_updateas well as a new name for the existing fallible version.When and if this gets stabilized, the existing
fetch_updateshould be marked as a deprecated alias fortry_update.Public API
Steps / History
AtomicT::update&AtomicT::try_update#133829 (comment)AtomicT::update&AtomicT::try_update#133829atomic_try_updateand deprecatefetch_updatestarting 1.99.0 #148590Unresolved Questions
AtomicT::update&AtomicT::try_update#133829 (comment)Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩