Skip to main content

TileRequestCoordinator

Struct TileRequestCoordinator 

Source
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

Source

pub fn new(config: CoordinatorConfig) -> Self

Create a new coordinator with the given configuration.

Source

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).

Source

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.

Source

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).

Source

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.

Source

pub fn finish_frame(&mut self)

Finish the frame: compute cross-source diagnostics.

Must be called once per frame after all source updates.

Source

pub fn stats(&self) -> &CoordinatorStats

Read-only access to the most recent cross-source diagnostics.

Source

pub fn config(&self) -> &CoordinatorConfig

Read-only access to the coordinator configuration.

Source

pub fn set_config(&mut self, config: CoordinatorConfig)

Replace the coordinator configuration.

Takes effect on the next begin_frame() call.

Trait Implementations§

Source§

impl Debug for TileRequestCoordinator

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TileRequestCoordinator

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.