pub struct RemoteSource { /* private fields */ }Expand description
Remote mirror + on-disk cache, replicating SRTM.py’s default behavior.
The mirror lists .hgt.zip files under region subdirectories; we scrape
the whole index once (8-ish requests) and memoize it. Tiles land in
cache_dir as plain .hgt files, so a DirSource pointed at the same
directory shares the cache.
Implementations§
Source§impl RemoteSource
impl RemoteSource
pub fn new(base_urls: &[&str], cache_dir: impl Into<PathBuf>) -> Result<Self>
Sourcepub fn default_paths() -> Result<Self>
pub fn default_paths() -> Result<Self>
Default mirror and default_cache_dir.
pub fn index(&self) -> Result<HashMap<String, String>>
pub fn load_or_download(&self, lat_lo: i32, lon_lo: i32) -> Result<Arc<Tile>>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RemoteSource
impl !RefUnwindSafe for RemoteSource
impl !UnwindSafe for RemoteSource
impl Send for RemoteSource
impl Sync for RemoteSource
impl Unpin for RemoteSource
impl UnsafeUnpin for RemoteSource
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