pub enum PromiseState {
Pending(Arc<Closure>),
Forced(Value),
}Expand description
State of a Value::Promise. Created Pending wrapping a thunk
(always a unary closure of zero args); on first force, the thunk
runs and the result replaces the state with Forced(value). All
subsequent forces return the cached value without re-evaluation.
Variants§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PromiseState
impl !UnwindSafe for PromiseState
impl Freeze for PromiseState
impl Send for PromiseState
impl Sync for PromiseState
impl Unpin for PromiseState
impl UnsafeUnpin for PromiseState
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