Struct embedded_threadsafe::lazy::LazyCell
source · pub struct LazyCell<T, I = fn() -> T> { /* private fields */ }Expand description
A lazily instantiated cell
Implementations§
source§impl<T, I> LazyCell<T, I>
impl<T, I> LazyCell<T, I>
sourcepub unsafe fn scope<F, FR>(&self, scope: F) -> FRwhere
I: FnOnce() -> T,
F: FnOnce(&mut T) -> FR,
pub unsafe fn scope<F, FR>(&self, scope: F) -> FRwhere I: FnOnce() -> T, F: FnOnce(&mut T) -> FR,
Provides scoped access to the underlying value, initializes it if necessary
Safety
This function provides unchecked, mutable access to the underlying value, so incorrect use of this function may lead to race conditions or undefined behavior.
Auto Trait Implementations§
impl<T, I = fn() -> T> !RefUnwindSafe for LazyCell<T, I>
impl<T, I> Send for LazyCell<T, I>where I: Send, T: Send,
impl<T, I = fn() -> T> !Sync for LazyCell<T, I>
impl<T, I> Unpin for LazyCell<T, I>where I: Unpin, T: Unpin,
impl<T, I> UnwindSafe for LazyCell<T, I>where I: UnwindSafe, T: UnwindSafe,
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