pub struct TileCache { /* private fields */ }Implementations§
Source§impl TileCache
impl TileCache
pub fn new(drive: &Path, limit_bytes: u64) -> Self
pub fn tile_path(&self, t: TileId) -> PathBuf
pub fn has(&self, t: TileId) -> bool
Sourcepub async fn get_or_fetch(&self, t: TileId) -> Result<PathBuf, String>
pub async fn get_or_fetch(&self, t: TileId) -> Result<PathBuf, String>
Return cached tile path, or fetch/store first.
Sourcepub fn evict_if_over_limit(&self) -> Result<u64, String>
pub fn evict_if_over_limit(&self) -> Result<u64, String>
Walk cache and evict oldest tiles until under cap.
pub fn clear(&self) -> Result<(), String>
pub fn current_size_bytes(&self) -> u64
pub fn set_limit_bytes(&mut self, limit: u64)
Trait Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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