pmtiles/
lib.rs

1#![cfg_attr(all(feature = "default"), doc = include_str!("../README.md"))]
2// Only here because we warn on `missing_docs`.
3// The first `cfg_attr` is exported to https://docs.rs
4#![cfg_attr(not(feature = "default"), doc = "# `PMTiles` (for Rust)")]
5
6#[cfg(feature = "__async")]
7mod async_reader;
8#[cfg(feature = "__async")]
9pub use async_reader::{AsyncBackend, AsyncPmTilesReader};
10
11mod backends;
12#[allow(unused_imports, reason = "only a warning if no backends are enabled")]
13pub use backends::*;
14
15#[cfg(feature = "__async")]
16mod cache;
17#[cfg(all(feature = "__async", feature = "moka"))]
18pub use cache::MokaCache;
19#[cfg(feature = "__async")]
20pub use cache::{DirCacheResult, DirectoryCache, HashMapCache, NoCache};
21
22mod directory;
23mod error;
24mod header;
25mod tile;
26#[cfg(feature = "write")]
27mod writer;
28
29/// Re-export of crate exposed in our API to simplify dependency management
30#[cfg(feature = "__async-aws-s3")]
31pub use aws_sdk_s3;
32#[cfg(feature = "iter-async")]
33pub use directory::DirEntryCoordsIter;
34pub use directory::{DirEntry, Directory};
35pub use error::{PmtError, PmtResult};
36pub use header::{Compression, Header, TileType};
37/// Re-export of crate exposed in our API to simplify dependency management
38#[cfg(feature = "http-async")]
39pub use reqwest;
40/// Re-export of crate exposed in our API to simplify dependency management
41#[cfg(feature = "__async-s3")]
42pub use s3;
43pub use tile::{MAX_TILE_ID, MAX_ZOOM, PYRAMID_SIZE_BY_ZOOM, TileCoord, TileId};
44/// Re-export of crate exposed in our API to simplify dependency management
45#[cfg(feature = "tilejson")]
46pub use tilejson;
47#[cfg(feature = "write")]
48pub use writer::{PmTilesStreamWriter, PmTilesWriter};
49
50#[cfg(test)]
51mod tests {
52    pub const RASTER_FILE: &str = "fixtures/stamen_toner(raster)CC-BY+ODbL_z3.pmtiles";
53    pub const VECTOR_FILE: &str = "fixtures/protomaps(vector)ODbL_firenze.pmtiles";
54}