Open
Description
Feature gate: #![feature(once_cell_get_mut)]
This is a tracking issue for
OnceCell::get_mut_or_init()
OnceCell::get_mut_or_try_init()
OnceLock::get_mut_or_init()
OnceLock::get_mut_or_try_init()
Public API
pub fn get_mut_or_try_init<F, E>(&mut self, f: F) -> Result<&mut T, E>
where
F: FnOnce() -> Result<T, E> { ... }
pub fn get_mut_or_init<F>(&mut self, f: F) -> &mut T
where
F: FnOnce() -> T { ... }
Steps / History
- ACP: Add get_mut_or_init and get_mut_or_try_init for OnceCell libs-team#294
- Implementation: impl get_mut_or_init and get_mut_or_try_init for OnceCell and OnceLock #114788
- Final comment period (FCP)
- Stabilization PR
Unresolved Questions
None yet.