pub struct Delay {
pub state: TrackedMutex<DelayState>,
/* private fields */
}Expand description
A lazy computation with a cached result and retry after interruption.
Fields§
§state: TrackedMutex<DelayState>Implementations§
Source§impl Delay
impl Delay
pub fn new(thunk: Box<dyn Thunk>) -> Self
Sourcepub fn force(&self) -> ValueResult<Value>
pub fn force(&self) -> ValueResult<Value>
Force the delay and cache the result. Errors are as for
LazySeq::try_realize.
Sourcepub fn is_realized(&self) -> bool
pub fn is_realized(&self) -> bool
True if the delay has already been forced.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Delay
impl !Send for Delay
impl !Sync for Delay
impl Forget for Delay
impl RefUnwindSafe for Delay
impl Unpin for Delay
impl UnsafeUnpin for Delay
impl UnwindSafe for Delay
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