pub enum TileData {
Raster(DecodedImage),
Vector(VectorTileData),
RawVector(RawVectorPayload),
}Expand description
The payload of a fetched tile.
Variants§
Raster(DecodedImage)
A decoded raster image (RGBA8).
Vector(VectorTileData)
Decoded vector tile with per-source-layer feature collections.
RawVector(RawVectorPayload)
Raw (undecoded) vector tile bytes awaiting background decode.
This variant is produced by [HttpVectorTileSource] when
deferred decoding is enabled and is promoted to Vector
once the background decode task completes.
Implementations§
Source§impl TileData
impl TileData
Sourcepub fn as_raster(&self) -> Option<&DecodedImage>
pub fn as_raster(&self) -> Option<&DecodedImage>
Return the raster image if this tile contains raster data.
Sourcepub fn as_vector(&self) -> Option<&VectorTileData>
pub fn as_vector(&self) -> Option<&VectorTileData>
Return the vector tile data if this tile contains vector data.
Sourcepub fn is_raw_vector(&self) -> bool
pub fn is_raw_vector(&self) -> bool
Return true if this is a raw (undecoded) vector tile.
Sourcepub fn as_raw_vector(&self) -> Option<&RawVectorPayload>
pub fn as_raw_vector(&self) -> Option<&RawVectorPayload>
Return the raw vector payload if this is an undecoded vector tile.
Sourcepub fn dimensions(&self) -> (u32, u32)
pub fn dimensions(&self) -> (u32, u32)
Return the raster dimensions in pixels.
Returns (0, 0) for vector tiles.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TileData
impl RefUnwindSafe for TileData
impl Send for TileData
impl Sync for TileData
impl Unpin for TileData
impl UnsafeUnpin for TileData
impl UnwindSafe for TileData
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