pub struct WorkContext { /* private fields */ }Expand description
Opaque evaluator-thread context for one native work scope.
Implementations§
Source§impl WorkContext
impl WorkContext
pub fn work_id(&self) -> WorkId
pub fn token(&self) -> WorkCancellationToken
pub fn cancelled(&self) -> bool
pub fn cancel_reason(&self) -> Option<Value>
pub fn deadline(&self) -> Option<Instant>
pub fn deadline_nanos(&self) -> Option<u64>
pub fn check_cancelled(&self) -> Result<(), PromiseRejection>
pub fn emit(&self, kind: Value, data: Value) -> bool
pub fn submit_child<F>( &self, options: WorkOptions, task: F, ) -> Result<WorkRun, String>
pub fn submit_child_rejection<F>( &self, options: WorkOptions, task: F, ) -> Result<WorkRun, String>
pub fn on_close<F>(&self, finalizer: F) -> bool
Trait Implementations§
Source§impl Clone for WorkContext
impl Clone for WorkContext
Source§fn clone(&self) -> WorkContext
fn clone(&self) -> WorkContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for WorkContext
impl !Send for WorkContext
impl !Sync for WorkContext
impl !UnwindSafe for WorkContext
impl Freeze for WorkContext
impl Unpin for WorkContext
impl UnsafeUnpin for WorkContext
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more