pub enum TileCacheEntry {
Pending,
Loaded(CachedTile),
Expired(CachedTile),
Reloading(CachedTile),
Failed {
error: String,
stale: Option<CachedTile>,
},
}Expand description
State of a tile in the cache.
Variants§
Pending
A fetch has been issued but no renderable payload exists yet.
Loaded(CachedTile)
The tile is loaded and considered fresh.
Expired(CachedTile)
The tile payload is stale but still renderable while refresh is pending.
Reloading(CachedTile)
A refresh is in flight; the previous payload remains renderable.
Failed
The tile fetch failed. The optional cached tile remains renderable when the failure happened during refresh/revalidation.
Implementations§
Source§impl TileCacheEntry
impl TileCacheEntry
Sourcepub fn is_pending(&self) -> bool
pub fn is_pending(&self) -> bool
Returns true if the entry is currently pending load.
Sourcepub fn is_loaded(&self) -> bool
pub fn is_loaded(&self) -> bool
Returns true if the entry currently has a loaded or reloadable payload.
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Returns true if the entry is in a stale-but-renderable expired state.
Sourcepub fn is_reloading(&self) -> bool
pub fn is_reloading(&self) -> bool
Returns true if the entry is actively reloading while keeping old data.
Sourcepub fn is_renderable(&self) -> bool
pub fn is_renderable(&self) -> bool
Returns true if this entry still has renderable tile data.
Sourcepub fn cached_tile(&self) -> Option<&CachedTile>
pub fn cached_tile(&self) -> Option<&CachedTile>
Return the loaded payload, if any.
Sourcepub fn freshness(&self) -> Option<&TileFreshness>
pub fn freshness(&self) -> Option<&TileFreshness>
Return freshness metadata for renderable entries.
Sourcepub fn loaded_at(&self) -> Option<SystemTime>
pub fn loaded_at(&self) -> Option<SystemTime>
Return the wall-clock time when this entry was promoted to Loaded.
Returns None for entries that have no renderable payload.