pub struct LazyData {
pub initializer: Arc<Mutex<Option<ValueWord>>>,
pub value: Arc<Mutex<Option<ValueWord>>>,
}Expand description
Lazy-initialized value — compute once, cache forever. The initializer closure runs at most once; subsequent accesses return the cached result.
Fields§
§initializer: Arc<Mutex<Option<ValueWord>>>Closure that produces the value (None after initialization).
value: Arc<Mutex<Option<ValueWord>>>Cached result (None until first access).
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LazyData
impl RefUnwindSafe for LazyData
impl Send for LazyData
impl Sync for LazyData
impl Unpin for LazyData
impl UnsafeUnpin for LazyData
impl UnwindSafe for LazyData
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