Tracking Issue for lazy_get
· Issue #129333 · rust-lang/rust (original) (raw)
This is a tracking issue for LazyCell/Lock::get[_mut]()
, allowing you to extract a reference from a Lazy
only if it is initialized, approved in ACP rust-lang/libs-team#429.
impl<T, F> core::cell::LazyCell<T, F> { pub fn get(this: &Self) -> Option<&T>; pub fn get_mut(this: &mut Self) -> Option<&mut T>; pub fn force_mut(this: &mut Self) -> &mut T; } impl<T, F> std::sync::LazyLock<T, F> { pub fn get(this: &Self) -> Option<&T>; pub fn get_mut(this: &mut Self) -> Option<&mut T>; pub fn force_mut(this: &mut Self) -> &mut T; }