Skip to main content

ElevationSource

Trait ElevationSource 

Source
pub trait ElevationSource: Send + Sync {
    // Required methods
    fn request(&self, id: TileId);
    fn poll(&self) -> Vec<(TileId, Result<ElevationGrid, TerrainError>)>;

    // Provided methods
    fn cancel(&self, _id: TileId) -> bool { ... }
    fn diagnostics(&self) -> Option<ElevationSourceDiagnostics> { ... }
}
Expand description

A source of elevation data for terrain tiles.

Same polling pattern as TileSource: the engine does not own an async runtime.

Required Methods§

Source

fn request(&self, id: TileId)

Start fetching elevation data for a tile. Returns immediately.

Source

fn poll(&self) -> Vec<(TileId, Result<ElevationGrid, TerrainError>)>

Poll for completed elevation fetches.

Provided Methods§

Source

fn cancel(&self, _id: TileId) -> bool

Cancel a queued request for a terrain tile if it has not yet been sent.

Returns true if the source found and removed a queued request. In-flight requests are unaffected and return false.

Source

fn diagnostics(&self) -> Option<ElevationSourceDiagnostics>

Optional source diagnostics for debugging terrain fetch/decode behavior.

Implementors§