pub struct SyntheticTileSource { /* private fields */ }Implementations§
Source§impl SyntheticTileSource
impl SyntheticTileSource
pub fn new() -> Self
pub fn with_tile_size(self, size: u32) -> Self
Trait Implementations§
Source§impl Default for SyntheticTileSource
impl Default for SyntheticTileSource
Source§impl TileSource for SyntheticTileSource
impl TileSource for SyntheticTileSource
Source§fn tile(&self, key: TileKey) -> Option<Image>
fn tile(&self, key: TileKey) -> Option<Image>
Return the tile at
(x, y, z), or None if it isn’t available
(out of bounds, missing from disk, not yet downloaded, …).
Implementations must not block the caller for long — kick off
any expensive fetch on a background task and return None until
the result lands in your cache.Source§fn tile_size(&self) -> u32
fn tile_size(&self) -> u32
Tile edge length in pixels. Default 256 matches every common
slippy-map source; vector / retina sources may emit 512.
Source§fn max_zoom(&self) -> u8
fn max_zoom(&self) -> u8
Inclusive maximum zoom level this source serves. Used by the
controller to clamp user-initiated zoom. Default is “any zoom
up to Web Mercator’s practical ceiling”.
Source§fn cancel_all_except(&self, _keep: &HashSet<TileKey>)
fn cancel_all_except(&self, _keep: &HashSet<TileKey>)
Drop any queued (but not yet started) work for keys NOT in
keep. Default no-op — synchronous sources have no in-flight
work to cancel. Fetching / decoding implementations should
override this so rapidly-panning consumers don’t accumulate
off-screen requests that waste bandwidth on tiles nobody will
see by the time they arrive.Auto Trait Implementations§
impl Freeze for SyntheticTileSource
impl RefUnwindSafe for SyntheticTileSource
impl Send for SyntheticTileSource
impl Sync for SyntheticTileSource
impl Unpin for SyntheticTileSource
impl UnsafeUnpin for SyntheticTileSource
impl UnwindSafe for SyntheticTileSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more