pub struct FileSystemTileProtocol { /* private fields */ }Expand description
Local file-system tile protocol.
Reads tiles from disk laid out as base_path/{z}/{x}/{y}.{ext}, where the
extension is derived from the requested TileFormat. This is a real,
Pure-Rust protocol with no network dependency — usable directly or as the
backing store for super::provider::TileSource::FileSystem.
Implementations§
Source§impl FileSystemTileProtocol
impl FileSystemTileProtocol
Sourcepub fn new(base_path: impl Into<PathBuf>, format: TileFormat) -> Self
pub fn new(base_path: impl Into<PathBuf>, format: TileFormat) -> Self
Create a new file-system tile protocol rooted at base_path.
The default supported zoom range is 0..=31; restrict it with
Self::with_zoom_levels.
Sourcepub fn with_zoom_levels(self, min_zoom: u8, max_zoom: u8) -> Self
pub fn with_zoom_levels(self, min_zoom: u8, max_zoom: u8) -> Self
Restrict the supported zoom range.
Sourcepub fn with_tile_size(self, width: u32, height: u32) -> Self
pub fn with_tile_size(self, width: u32, height: u32) -> Self
Set the tile size in pixels.
Sourcepub fn tile_path(&self, coord: &TileCoordinate) -> PathBuf
pub fn tile_path(&self, coord: &TileCoordinate) -> PathBuf
On-disk path for a tile: base_path/{z}/{x}/{y}.{ext}.
Trait Implementations§
Source§impl TileProtocol for FileSystemTileProtocol
impl TileProtocol for FileSystemTileProtocol
Source§fn get_tile<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 TileRequest,
) -> Pin<Box<dyn Future<Output = Result<TileResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_tile<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 TileRequest,
) -> Pin<Box<dyn Future<Output = Result<TileResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a tile.
Source§fn has_tile<'life0, 'life1, 'async_trait>(
&'life0 self,
coord: &'life1 TileCoordinate,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn has_tile<'life0, 'life1, 'async_trait>(
&'life0 self,
coord: &'life1 TileCoordinate,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if a tile exists.
Source§fn get_tile_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
coord: &'life1 TileCoordinate,
) -> Pin<Box<dyn Future<Output = Result<TileMetadata>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_tile_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
coord: &'life1 TileCoordinate,
) -> Pin<Box<dyn Future<Output = Result<TileMetadata>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get tile metadata.
Source§fn zoom_levels(&self) -> (u8, u8)
fn zoom_levels(&self) -> (u8, u8)
Get the supported zoom levels.
Auto Trait Implementations§
impl Freeze for FileSystemTileProtocol
impl RefUnwindSafe for FileSystemTileProtocol
impl Send for FileSystemTileProtocol
impl Sync for FileSystemTileProtocol
impl Unpin for FileSystemTileProtocol
impl UnsafeUnpin for FileSystemTileProtocol
impl UnwindSafe for FileSystemTileProtocol
Blanket Implementations§
impl<T> Allocation for T
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