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
pub fn clear(&mut 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.
pub fn put_tile(&mut self, tile: StoredTile)
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 create_tile(&mut self, coords: WorldTileCoords) -> bool
pub fn create_tile(&mut self, coords: WorldTileCoords) -> bool
Create a new tile.
sourcepub fn has_tile(&self, coords: &WorldTileCoords) -> bool
pub fn has_tile(&self, coords: &WorldTileCoords) -> bool
Checks if a layer has been fetched.
pub fn mark_tile_succeeded(&mut self, coords: &WorldTileCoords)
sourcepub fn mark_tile_failed(&mut self, coords: &WorldTileCoords)
pub fn mark_tile_failed(&mut self, coords: &WorldTileCoords)
Checks if a layer has been fetched.
Trait Implementations
sourceimpl Default for TileRepository
impl Default for TileRepository
sourcefn default() -> TileRepository
fn default() -> TileRepository
Returns the “default value” for a type. Read more
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
Mutably borrows from an owned value. Read more
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s. Read more