pub struct TileKey {
pub z: u8,
pub x: u32,
pub y: u32,
pub layer: String,
pub format: TileFormat,
}Expand description
Uniquely identifies a tile by zoom level, column, row, layer name, and format.
Fields§
§z: u8Zoom level (0–22).
x: u32Tile column.
y: u32Tile row.
layer: StringLayer name.
format: TileFormatSerialization format.
Implementations§
Source§impl TileKey
impl TileKey
Sourcepub fn new(
z: u8,
x: u32,
y: u32,
layer: impl Into<String>,
format: TileFormat,
) -> Self
pub fn new( z: u8, x: u32, y: u32, layer: impl Into<String>, format: TileFormat, ) -> Self
Creates a new TileKey.
Sourcepub fn path_string(&self) -> String
pub fn path_string(&self) -> String
Returns the canonical path string "{layer}/{z}/{x}/{y}.{ext}".
Sourcepub fn content_type(&self) -> &'static str
pub fn content_type(&self) -> &'static str
Returns the MIME content-type for this tile’s format.
Trait Implementations§
impl Eq for TileKey
impl StructuralPartialEq for TileKey
Auto Trait Implementations§
impl Freeze for TileKey
impl RefUnwindSafe for TileKey
impl Send for TileKey
impl Sync for TileKey
impl Unpin for TileKey
impl UnsafeUnpin for TileKey
impl UnwindSafe for TileKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more