Skip to main content

Module arriving

Module arriving 

Expand description

Data that is not here yet: the one model for every read whose answer arrives later.

An Arriving value is a read in flight, its Arrival pending (with the Source the answer comes from), ready or failed. App code says only what it shows once the data is there; the framework decides every timing and placeholder (crate::widget::ArrivingView):

  • Local data answers within a frame or two: the frame that would show it waits up to one frame budget (frame_budget), and an answer inside it shows with no placeholder and no motion. A local read that misses the budget (a cold disk) behaves like a remote one.
  • Remote data reserves its space at the content’s geometry: nothing but that ground for GRACE, then a skeleton in the content’s shape for at least MIN_SHOWN so it never flashes, saying where it comes from after NAME_SOURCE_AFTER. The answer cross-fades in (crate::motion::CrossFade::arrive); a failure turns the reserved space into the error, with a retry.

Every timed step is a deadline (ArrivalClock::next_step_at) served by the window’s wake scheduler, so a pending read draws no frames between its steps.

A window whose first frame is not drawn is the same arrival at a tile’s scale (crate::widget::TileHost): its content says where that frame comes from and, when what it waits on can measure itself, how much of it has come (Progress). The answer lives in a LocalState, so a bound view updates and an idle window wakes when it lands; Arriving::begin restarts the read and makes every older ArrivalCompletion stale, so a slow answer can never overwrite a newer one.

Structs§

ArrivalClock
The timing of one read, from the moment it was asked: the one place the placeholder steps are decided, for crate::widget::ArrivingView and for immediate-mode painters alike.
ArrivalCompletion
The single-use capability of one restart of a read (Arriving::begin). Only the newest restart may publish.
ArrivalWriter
Publishes a read’s answers without restarting it. See Arriving::writer.
Arriving
A read whose answer arrives later. Clones share one read.
Progress
How much of a pending answer has come, when what it waits on can measure itself (a download). The placeholder says it from its skeleton on (crate::widget::ArrivalFace::with_progress).

Enums§

Arrival
Where one read stands.
Source
Where data that is not here yet comes from. The read fills it in: a read through this device’s store says Self::Local, one answered by a workspace’s host says Self::Host.
Step
What a placeholder shows at a moment of its read.

Constants§

GRACE
How long a remote read shows nothing but its reserved ground.
MIN_SHOWN
The shortest time a skeleton stays once it showed: it never flashes.
NAME_SOURCE_AFTER
When a placeholder starts saying where its data comes from.

Functions§

frame_budget
One frame at the display’s rate: how long a frame waits for local data, and how soon a local answer must land to show without motion.
set_frame_budget
The window’s display refreshes every interval: the frame budget local reads get. The native runner calls this when it learns the display’s refresh rate.