pub struct JobError { /* private fields */ }Expand description
A failed job’s exception, kept inside its runtime.
Returned by Ctx::drain_jobs and, with the
"futures" feature, by AsyncContext::async_with, AsyncRuntime::idle
and AsyncRuntime::drive.
The token carries no JavaScript value and is Send: the exception stays in
its runtime until it is evicted by an older-first FIFO (holding up to
MAX_JOB_ERRORS failures) or the runtime is dropped.
The value is cloned on extraction, so a token can be used more than once.
Implementations§
Source§impl JobError
impl JobError
Sourcepub fn into_value<'js>(&self, ctx: &Ctx<'js>) -> Result<Value<'js>>
pub fn into_value<'js>(&self, ctx: &Ctx<'js>) -> Result<Value<'js>>
Clone the exception out of the runtime.
ctx must belong to the runtime the job ran in — not necessarily the
same context. Ids are process-wide unique, so a context from another
runtime cannot resolve to a different exception; Error::JobErrorUnavailable
is returned instead. It is also returned if the failure was evicted
from the bounded FIFO, or the runtime was dropped.
Trait Implementations§
Source§impl Error for JobError
impl Error for JobError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Forget for JobError
impl Freeze for JobError
impl Move for JobError
impl RefUnwindSafe for JobError
impl Send for JobError
impl Sync for JobError
impl Unpin for JobError
impl UnsafeUnpin for JobError
impl UnwindSafe for JobError
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
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> ⓘ
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> ⓘ
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