pub struct TileCache { /* private fields */ }Expand description
LRU tile cache
Implementations§
Source§impl TileCache
impl TileCache
Sourcepub fn with_default_size() -> Self
pub fn with_default_size() -> Self
Creates a new tile cache with default size
Sourcepub fn get(&mut self, coord: &TileCoord, timestamp: f64) -> Option<Vec<u8>>
pub fn get(&mut self, coord: &TileCoord, timestamp: f64) -> Option<Vec<u8>>
Gets a tile from the cache
Sourcepub fn put(
&mut self,
coord: TileCoord,
data: Vec<u8>,
timestamp: f64,
) -> WasmResult<()>
pub fn put( &mut self, coord: TileCoord, data: Vec<u8>, timestamp: f64, ) -> WasmResult<()>
Puts a tile into the cache
Sourcepub fn stats(&self) -> CacheStats
pub fn stats(&self) -> CacheStats
Returns cache statistics
Sourcepub fn prefetch_list(&self, coords: &[TileCoord]) -> Vec<TileCoord>
pub fn prefetch_list(&self, coords: &[TileCoord]) -> Vec<TileCoord>
Prefetches tiles in the given coordinates
Auto Trait Implementations§
impl Freeze for TileCache
impl RefUnwindSafe for TileCache
impl Send for TileCache
impl Sync for TileCache
impl Unpin for TileCache
impl UnsafeUnpin for TileCache
impl UnwindSafe 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