pub struct MapTileCache { /* private fields */ }Expand description
a cache for map tiles on the local filesystem
Implementations§
Source§impl MapTileCache
impl MapTileCache
Sourcepub fn new(cache_directory: PathBuf, ratelimiter: Option<Ratelimiter>) -> Self
pub fn new(cache_directory: PathBuf, ratelimiter: Option<Ratelimiter>) -> Self
creates a new MapTileCache
Sourcepub async fn get_map_tile(
&mut self,
map_tile_descriptor: &MapTileDescriptor,
) -> Result<Option<MapTile>, MapTileCacheError>
pub async fn get_map_tile( &mut self, map_tile_descriptor: &MapTileDescriptor, ) -> Result<Option<MapTile>, MapTileCacheError>
fetches a map tile from the Second Life main map servers or the local cache
§Errors
returns an error if the HTTP request fails of if the result fails to be parsed as an image
Sourcepub async fn does_map_tile_exist(
&mut self,
map_tile_descriptor: &MapTileDescriptor,
) -> Result<bool, MapTileCacheError>
pub async fn does_map_tile_exist( &mut self, map_tile_descriptor: &MapTileDescriptor, ) -> Result<bool, MapTileCacheError>
figures out if a map tile exist by checking the local in-memory and disk caches or fetching the map tile from the server
§Errors
returns an error if fetching the map tile from cache or remotely fails
Sourcepub async fn does_region_exist(
&mut self,
grid_coordinates: &GridCoordinates,
) -> Result<bool, MapTileCacheError>
pub async fn does_region_exist( &mut self, grid_coordinates: &GridCoordinates, ) -> Result<bool, MapTileCacheError>
figures out if a region exists based on the existence of map tiles for it, starting with the lowest zoom level and potentially going up to the highest one if all the other zoom levels have a tile for that region
§Errors
returns an error if fetching map tiles from cache or remotely fails
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MapTileCache
impl !RefUnwindSafe for MapTileCache
impl Send for MapTileCache
impl Sync for MapTileCache
impl Unpin for MapTileCache
impl UnsafeUnpin for MapTileCache
impl !UnwindSafe for MapTileCache
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.