pub struct CljxFuture {
pub state: Mutex<FutureState>,
pub cond: Condvar,
/* private fields */
}Expand description
A future value computed asynchronously on another thread.
Fields§
§state: Mutex<FutureState>§cond: CondvarImplementations§
Source§impl CljxFuture
impl CljxFuture
pub fn new() -> Self
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
True if explicitly cancelled.
Sourcepub fn cancel(&self) -> bool
pub fn cancel(&self) -> bool
Mark a still-running future cancelled, waking anyone waiting on it.
Returns false when it had already settled. The task itself is not interrupted; what is cancelled is the result.
Sourcepub fn cancelled_error() -> Value
pub fn cancelled_error() -> Value
The catchable value every reader of a cancelled future raises.
One shape for every path — the sync tree-walker’s await/deref, the
async tree-walker, and the compiled state machine all hand user code
the same ex-info-like error, so a catch behaves the same whether or
not the enclosing fn happened to be async-JIT-compiled.
Sourcepub fn mark_observed(&self)
pub fn mark_observed(&self)
Mark this future’s result as observed. Call when a consumer reads the
settled value (await/deref), so a later drop doesn’t warn about an
unobserved error.
Trait Implementations§
Source§impl Debug for CljxFuture
impl Debug for CljxFuture
Source§impl Default for CljxFuture
impl Default for CljxFuture
Source§impl Drop for CljxFuture
impl Drop for CljxFuture
Source§impl Trace for CljxFuture
impl Trace for CljxFuture
fn trace(&self, visitor: &mut MarkVisitor)
fn gc_size_extra(&self) -> usize
Auto Trait Implementations§
impl !Freeze for CljxFuture
impl !Send for CljxFuture
impl !Sync for CljxFuture
impl RefUnwindSafe for CljxFuture
impl Unpin for CljxFuture
impl UnsafeUnpin for CljxFuture
impl UnwindSafe for CljxFuture
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