Skip to main content

Module wait

Module wait 

Source
Expand description

Blocking until a region matches or stops matching — the decisions behind pixelcoords wait.

The loop itself lives in the binary, because polling needs a capture. What lives here is everything that decides when it ends, and the reason it lives here is that a clock would otherwise be load-bearing: --timeout is turned into a poll budget once, up front, so the loop counts rather than consults the time.

That is not only about testability, though it does mean wait needs no Clock trait and no injected sleep. A wall-clock deadline gives the UI fewer chances exactly when the machine is slowest, because more of the deadline goes to capturing — backwards for a synchronization primitive. A budget gives the same number of chances everywhere.

Structs§

RegionWatch
One watched region’s final state — a row of wait’s report.

Enums§

Condition
What wait is waiting for.
WaitError

Functions§

poll_budget
How many polls a timeout allows.
satisfied
Whether one poll’s scores end the wait.