Skip to main content

PooledTileSource

Struct PooledTileSource 

Source
pub struct PooledTileSource { /* private fields */ }
Expand description

A TileSource that fetches tiles over HTTP with concurrency limiting and viewport-center priority ordering via FetchPool.

Implementations§

Source§

impl PooledTileSource

Source

pub fn new( url_template: impl Into<String>, client: Box<dyn HttpClient>, max_concurrent: usize, ) -> Self

Create a new pooled tile source without image decoding.

Response bodies are assumed to be raw RGBA8 256x256 pixel data. For real tile providers use with_decoder.

Source

pub fn with_decoder( url_template: impl Into<String>, client: Box<dyn HttpClient>, max_concurrent: usize, decoder: Box<dyn TileDecoder>, ) -> Self

Create a new pooled tile source with a TileDecoder.

Source

pub fn with_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Self

Add a default header that will be sent with every tile request.

Trait Implementations§

Source§

impl Debug for PooledTileSource

Source§

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

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

impl TileSource for PooledTileSource

Source§

fn request(&self, id: TileId)

Start fetching a tile. Returns immediately. Read more
Source§

fn request_revalidate(&self, id: TileId, hint: RevalidationHint)

Start a conditional revalidation fetch for a stale tile. Read more
Source§

fn poll(&self) -> Vec<(TileId, Result<TileResponse, TileError>)>

Poll for completed tile fetches. Read more
Source§

fn cancel(&self, id: TileId)

Cancel a previously requested tile fetch. Read more
Source§

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

Optional runtime diagnostics about the source fetch pipeline.
Source§

fn request_many(&self, ids: &[TileId])

Start fetching multiple tiles. Read more
Source§

fn request_revalidate_many(&self, ids: &[(TileId, RevalidationHint)])

Start conditional revalidation for multiple tiles. Read more
Source§

fn cancel_many(&self, ids: &[TileId])

Cancel multiple previously requested tile fetches. 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.