pub struct Lazy<A> { /* private fields */ }
Expand description
A representation for a value that may not be available until the current transaction is closed.
Implementations§
source§impl<A: Send + Clone + 'static> Lazy<A>
impl<A: Send + Clone + 'static> Lazy<A>
sourcepub fn new<THUNK: FnMut() -> A + Send + 'static>(thunk: THUNK) -> Lazy<A>
pub fn new<THUNK: FnMut() -> A + Send + 'static>(thunk: THUNK) -> Lazy<A>
Create a new Lazy
whose value will be computed with the
given function sometime after the end of the current
transaction.
Trait Implementations§
Auto Trait Implementations§
impl<A> !RefUnwindSafe for Lazy<A>
impl<A> Send for Lazy<A>where
A: Send,
impl<A> Sync for Lazy<A>where
A: Send,
impl<A> Unpin for Lazy<A>
impl<A> !UnwindSafe for Lazy<A>
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