pub struct PendingFetch {
pub cx: *mut JSContext,
pub promise_root: Option<RawValueRootGuard>,
pub promise_val: Value,
pub outcome: Arc<Mutex<Option<Result<StealthSyncResult, String>>>>,
pub kind: ResolveKind,
/* private fields */
}Expand description
A fetch tasklet: pending Promise + event-driven HTTP integration.
Invariants (FetchTaskletLifecycle SM):
promise_rootholds the heap root while the Promise is outstanding; it is released RAII-style when the PendingFetch Box drops (every terminal resolve/reject path ends in that drop).has_schedule_callbackprevents duplicate ConcurrentTask scheduling.outcomeis written byon_http_done(HTTPThread) and consumed byresolve_tasklet(JS thread via ConcurrentTask).
Fields§
§cx: *mut JSContextSpiderMonkey context that owns the Promise. Only touched on the JS thread.
promise_root: Option<RawValueRootGuard>RAII heap root (GUARD-A) keeping the pending Promise alive across the
async window. None only when rooting failed at spawn (pre-existing
degraded path: the unrooted promise_val snapshot below is used).
promise_val: ValuePromise value snapshot taken at spawn. The live value is
promise_root.get(0) (updated in place by a moving GC); this is the
fallback when rooting failed.
outcome: Arc<Mutex<Option<Result<StealthSyncResult, String>>>>HTTPThread result slot. None until on_http_done writes the outcome.
kind: ResolveKindHow to materialize the result on the JS thread.
Trait Implementations§
impl Send for PendingFetch
Auto Trait Implementations§
impl !Freeze for PendingFetch
impl !RefUnwindSafe for PendingFetch
impl !Sync for PendingFetch
impl !UnwindSafe for PendingFetch
impl Unpin for PendingFetch
impl UnsafeUnpin for PendingFetch
Blanket Implementations§
Source§impl<T> AsCtxPtr for Twhere
T: ?Sized,
impl<T> AsCtxPtr for Twhere
T: ?Sized,
Source§fn as_ctx_ptr(&self) -> *mut Selfwhere
Self: Sized,
fn as_ctx_ptr(&self) -> *mut Selfwhere
Self: Sized,
self’s address as *mut Self for deferred-task / scopeguard /
ref_guard ctx slots. The closures/trampolines deref it as shared
(&*p) — every method they reach is &self post-R-2, so no write
provenance is required; the *mut spelling is purely to match the
existing DerefOnDrop / HasAutoFlush / RefCount ABI.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
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert