pub struct TileCache { /* private fields */ }Expand description
Tile cache implementation.
Implementations§
Source§impl TileCache
impl TileCache
Sourcepub fn new(config: TileCacheConfig) -> Result<Self>
pub fn new(config: TileCacheConfig) -> Result<Self>
Create a new tile cache.
Sourcepub async fn get(&self, coord: &TileCoordinate) -> Option<TileResponse>
pub async fn get(&self, coord: &TileCoordinate) -> Option<TileResponse>
Get a tile from cache.
Sourcepub async fn put(&self, response: TileResponse) -> Result<()>
pub async fn put(&self, response: TileResponse) -> Result<()>
Put a tile in cache.
Sourcepub async fn stats(&self) -> CacheStats
pub async fn stats(&self) -> CacheStats
Get cache statistics.
Auto Trait Implementations§
impl !RefUnwindSafe for TileCache
impl !UnwindSafe for TileCache
impl Freeze for TileCache
impl Send for TileCache
impl Sync for TileCache
impl Unpin for TileCache
impl UnsafeUnpin for TileCache
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