pub struct TileRequestCoordinator { /* private fields */ }Expand description
Centralises tile-request scheduling across all active sources.
See the module-level documentation for the design rationale and integration points.
Implementations§
Source§impl TileRequestCoordinator
impl TileRequestCoordinator
Sourcepub fn new(config: CoordinatorConfig) -> Self
pub fn new(config: CoordinatorConfig) -> Self
Create a new coordinator with the given configuration.
Sourcepub fn budget_for(&self, priority: SourcePriority) -> usize
pub fn budget_for(&self, priority: SourcePriority) -> usize
Return the request budget allocated for priority this frame.
MapState should call this before invoking
TileLayer::update_with_view and pass the result as
TileSelectionConfig::max_requests_per_frame so that the
TileManager respects the coordinator’s global budget.
Returns usize::MAX when coordination is disabled
(global_request_budget == 0).
Sourcepub fn report(
&mut self,
priority: SourcePriority,
desired: HashSet<TileId>,
issued: usize,
pending_demand: usize,
)
pub fn report( &mut self, priority: SourcePriority, desired: HashSet<TileId>, issued: usize, pending_demand: usize, )
Record the desired tile set and request count for a source class.
desired is the set of tile IDs the source wants to render.
issued is the number of new HTTP requests actually dispatched
during this frame’s update.
pending_demand is the number of desired tiles that still need
loading (fallback + missing). This drives the budget allocation
for the next frame even when the current frame’s budget was zero.
Sourcepub fn report_demand(&mut self, priority: SourcePriority, demand: usize)
pub fn report_demand(&mut self, priority: SourcePriority, demand: usize)
Record only the demand (pending request count) for a source class, without replacing its desired tile set.
Useful for sources that don’t expose their full desired set (e.g. terrain DEM, which computes tiles internally).
Sourcepub fn begin_frame(&mut self)
pub fn begin_frame(&mut self)
Begin a new frame: allocate per-source budgets from the global cap.
Must be called once per frame before any source updates.
Sourcepub fn finish_frame(&mut self)
pub fn finish_frame(&mut self)
Finish the frame: compute cross-source diagnostics.
Must be called once per frame after all source updates.
Sourcepub fn stats(&self) -> &CoordinatorStats
pub fn stats(&self) -> &CoordinatorStats
Read-only access to the most recent cross-source diagnostics.
Sourcepub fn config(&self) -> &CoordinatorConfig
pub fn config(&self) -> &CoordinatorConfig
Read-only access to the coordinator configuration.
Sourcepub fn set_config(&mut self, config: CoordinatorConfig)
pub fn set_config(&mut self, config: CoordinatorConfig)
Replace the coordinator configuration.
Takes effect on the next begin_frame() call.