Struct maplibre::io::tile_repository::TileRepository
source · [−]pub struct TileRepository {
tree: BTreeMap<Quadkey, StoredTile>,
}Expand description
Stores and provides access to a quad tree of cached tiles with world tile coords.
Fields
tree: BTreeMap<Quadkey, StoredTile>Implementations
sourceimpl TileRepository
impl TileRepository
pub fn new() -> Self
sourcepub fn put_layer(&mut self, layer: StoredLayer)
pub fn put_layer(&mut self, layer: StoredLayer)
Inserts a tessellated layer into the quad tree at its world tile coords. If the space is vacant, the tessellated layer is inserted into a new crate::io::tile_repository::StoredLayer. If the space is occupied, the tessellated layer is added to the current crate::io::tile_repository::StoredLayer.
sourcepub fn iter_layers_at(
&self,
coords: &WorldTileCoords
) -> Option<impl Iterator<Item = &StoredLayer> + '_>
pub fn iter_layers_at(
&self,
coords: &WorldTileCoords
) -> Option<impl Iterator<Item = &StoredLayer> + '_>
Returns the list of tessellated layers at the given world tile coords. None if tile is missing from the cache.
sourcepub fn iter_loaded_layers_at<Q: Queue<B>, B, V: Pod, I: Pod, TM: Pod, FM: Pod>(
&self,
buffer_pool: &BufferPool<Q, B, V, I, TM, FM>,
coords: &WorldTileCoords
) -> Option<Vec<&StoredLayer>>
pub fn iter_loaded_layers_at<Q: Queue<B>, B, V: Pod, I: Pod, TM: Pod, FM: Pod>(
&self,
buffer_pool: &BufferPool<Q, B, V, I, TM, FM>,
coords: &WorldTileCoords
) -> Option<Vec<&StoredLayer>>
Returns the list of tessellated layers at the given world tile coords, which are loaded in the BufferPool
sourcepub fn is_tile_pending_or_done(&self, coords: &WorldTileCoords) -> bool
pub fn is_tile_pending_or_done(&self, coords: &WorldTileCoords) -> bool
Checks fetching of a tile has been started
sourcepub fn mark_tile_pending(
&mut self,
coords: WorldTileCoords
) -> Result<(), MarkError>
pub fn mark_tile_pending(
&mut self,
coords: WorldTileCoords
) -> Result<(), MarkError>
Mark the tile at coords pending in this tile repository.
sourcepub fn mark_tile_succeeded(
&mut self,
coords: &WorldTileCoords
) -> Result<(), MarkError>
pub fn mark_tile_succeeded(
&mut self,
coords: &WorldTileCoords
) -> Result<(), MarkError>
Mark the tile at coords succeeded in this tile repository. Only succeeds if there is a
pending tile at coords.
sourcepub fn mark_tile_failed(
&mut self,
coords: &WorldTileCoords
) -> Result<(), MarkError>
pub fn mark_tile_failed(
&mut self,
coords: &WorldTileCoords
) -> Result<(), MarkError>
Mark the tile at coords failed in this tile repository. Only succeeds if there is a
pending tile at coords.
fn mark_tile(
&mut self,
coords: &WorldTileCoords,
status: TileStatus
) -> Result<(), MarkError>
pub fn put_tile(&mut self, tile: StoredTile)
pub fn clear(&mut self)
Trait Implementations
sourceimpl Default for TileRepository
impl Default for TileRepository
sourcefn default() -> TileRepository
fn default() -> TileRepository
Auto Trait Implementations
impl RefUnwindSafe for TileRepository
impl Send for TileRepository
impl Sync for TileRepository
impl Unpin for TileRepository
impl UnwindSafe for TileRepository
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read morefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read morefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s. Read morefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s. Read more