pub struct SessionPendingWork {
pub timer: Option<Duration>,
pub microtasks: bool,
pub external: bool,
}Expand description
Work a hosted document still owns after the current turn.
The delay is relative to the host clock at the point of inspection. A
session with no pending work returns Self::idle. The source flags keep
the completion receipt honest while the wake deadline lets a host sleep
until a timer is due instead of repainting continuously.
Fields§
§timer: Option<Duration>Time until the earliest runtime timer is due, if the session exposes one. A zero delay means the host should wake immediately.
microtasks: boolWhether the session still has microtasks to drain on its next pump.
external: boolWhether a host-owned asynchronous source may complete the session.
Implementations§
Source§impl SessionPendingWork
impl SessionPendingWork
pub const fn idle() -> Self
pub const fn timer(delay: Duration) -> Self
pub const fn is_idle(self) -> bool
Sourcepub const fn is_settled(self) -> bool
pub const fn is_settled(self) -> bool
Whether script-visible completion has settled. A future timer may still repaint the page, but it does not keep a completion receipt open; host external work and microtasks do.