Expand description
The JS↔gpui call boundary: raw &mut App / &mut Window pointers are published for a bounded scope
with an RAII guard (so a panic cannot leave a dangling pointer), tagged with a Phase. Host
functions reach them only through with_commit / with_app; outside a published scope those
return None and the caller must throw a JS error rather than touch gpui.
Enums§
Functions§
- describe_
panic - drain_
owed - install_
panic_ hook - owe_
drain - A dispatch made under a gpui listener leaves its microtask checkpoint owed; every JS entry settles it
first (
settle_owed_drain). Call BEFORE the dispatch’s call into JS. Keeps the engine’s API lock until settled (JSC drains microtasks when the outermost lock is released). Returnsfalseand owes nothing when JS is already running below the dispatch: owing there keeps a lock past the heap-access release and JSC aborts. - panic_
to_ js - poison
- poison_
reason - poison_
with poison, keeping the first reason given: the panic that broke the runtime, not one that followed.- poisoned
- settle_
owed_ drain - Runs the owed checkpoint, if any, and releases the API lock. Every publication runs it first.
- with_
app - with_
commit - The commit-phase accessor;
Noneoutside aPhase::Commitpublication: throw, don’t fall back. - with_
draw - Runs
f, aWindow::drawmade inside a publication, asPhase::Draw: nothing is reachable until it returns (a forced layout draws from insidePhase::Commit; handing the pointers out again would alias). - with_
published - Publishes
window+cxfor the duration off, after settling an owed checkpoint. - with_
published_ app