pub struct ForceTickContext { /* private fields */ }Expand description
A per-surface force-tick signal, subscribed by every segment on that surface. Bumped after each event so segments re-run even when their view reads signals the effect cannot auto-track — notably the binary-side root segment under hot reload, whose view reads signals created in the app dylib (cross-boundary tracking is unreliable, so the force-tick makes it re-read current values, e.g. the real viewport). Per-surface so one surface’s event does not force-render the others; a global change (theme) re-renders all surfaces via its own shared signal, not this tick.
Implementations§
Source§impl ForceTickContext
impl ForceTickContext
Sourcepub fn enter(&self) -> ForceTickGuard
pub fn enter(&self) -> ForceTickGuard
Makes this instance the live one until the returned guard drops, which restores the previously-active instance. Nest by keeping guards in scope; they restore in reverse order.
Sourcepub fn enter_ambient() -> ForceTickGuard
pub fn enter_ambient() -> ForceTickGuard
Makes the ambient instance — the one that exists before any surface is built, and the only world a single-surface app ever has — live until the returned guard drops.
What the reactive flush needs for an effect owned by SurfaceHandle::NONE:
it was registered outside any surface, so its world is this one, and running it against
whichever surface happened to be entered when the signal fired would resolve its layout,
overlays and focus in somebody else’s. Reachable as soon as one app has both — a window tree
that never built a surface and a second tree that did.