pub struct ContainerRegistry { /* private fields */ }Expand description
Re‑exports reader/writer traits, converters, and auxiliary types. Registry mapping file extensions to async tile container readers and writers.
Supports reading and writing of tile containers in formats such as:
MBTiles- TAR
PMTilesVersaTiles- Directory-based containers
Implementations§
Source§impl ContainerRegistry
impl ContainerRegistry
Sourcepub fn new_empty() -> Self
pub fn new_empty() -> Self
Creates a new ContainerRegistry with the specified runtime.
Registers built-in readers and writers for supported container formats.
pub async fn reader_from_str( &self, data_source: &str, runtime: TilesRuntime, ) -> Result<SharedTileSource>
Sourcepub async fn reader_from_location(
&self,
location: DataLocation,
runtime: TilesRuntime,
) -> Result<SharedTileSource>
pub async fn reader_from_location( &self, location: DataLocation, runtime: TilesRuntime, ) -> Result<SharedTileSource>
Get a tile container reader for a given DataLocation (path or URL).
Sourcepub async fn reader(
&self,
data_source: DataSource,
runtime: TilesRuntime,
) -> Result<SharedTileSource>
pub async fn reader( &self, data_source: DataSource, runtime: TilesRuntime, ) -> Result<SharedTileSource>
Sourcepub async fn write_to_path(
&self,
reader: SharedTileSource,
path: &Path,
runtime: TilesRuntime,
) -> Result<()>
pub async fn write_to_path( &self, reader: SharedTileSource, path: &Path, runtime: TilesRuntime, ) -> Result<()>
Write tiles with a custom runtime for progress monitoring and other options.
§Arguments
reader- A shared tile source providing tiles to write.path- The output path to write tiles to.runtime- Runtime configuration (cache type, event bus, progress factory, etc.).
§Returns
Result indicating success or failure.
Sourcepub async fn write_to_str(
&self,
reader: SharedTileSource,
destination: &str,
runtime: TilesRuntime,
) -> Result<()>
pub async fn write_to_str( &self, reader: SharedTileSource, destination: &str, runtime: TilesRuntime, ) -> Result<()>
Write tiles to a destination specified as a string (path or SFTP URL).
Detects sftp:// URLs and writes via SFTP when the ssh2 feature is enabled.
Otherwise falls back to path-based writing.
Sourcepub fn register_reader<R: TilesReader + 'static>(&mut self, ext: &str)
pub fn register_reader<R: TilesReader + 'static>(&mut self, ext: &str)
Register both file and (optionally) data readers for a TilesReader implementation.
The file reader is always registered. The data reader is only registered when
R::supports_data_reader() returns true.
Sourcepub fn register_writer<W: TilesWriter + 'static>(&mut self, ext: &str)
pub fn register_writer<W: TilesWriter + 'static>(&mut self, ext: &str)
Register both file and (optionally) data writers for a TilesWriter implementation.
The file writer is always registered. The data writer is only registered when
W::supports_data_writer() returns true.
pub fn supports_reader_extension(&self, ext: &str) -> bool
pub fn supports_writer_extension(&self, ext: &str) -> bool
Trait Implementations§
Source§impl Clone for ContainerRegistry
impl Clone for ContainerRegistry
Source§fn clone(&self) -> ContainerRegistry
fn clone(&self) -> ContainerRegistry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ContainerRegistry
impl !UnwindSafe for ContainerRegistry
impl Freeze for ContainerRegistry
impl Send for ContainerRegistry
impl Sync for ContainerRegistry
impl Unpin for ContainerRegistry
impl UnsafeUnpin for ContainerRegistry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.