1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! This module provides functionality for handling tiles stored in tar archives.
//!
//! It includes implementations for both reading from and writing to tar files that contain tile data.
//!
//! ## Overview
//! The module exposes two primary structs:
//! - `TarTilesReader`: For reading tiles from a tar archive.
//! - `TarTilesWriter`: For writing tiles to a tar archive.
//!
//! ## Usage Example
//!
//! ```no_run
//! use versatiles_container::*;
//! use versatiles_core::*;
//! use std::{path::Path, sync::Arc};
//! use anyhow::Result;
//!
//! #[tokio::main]
//! async fn main() -> Result<()> {
//! // Reading from a tar archive
//! let tar_path = Path::new("path/to/your/tarfile.tar");
//! let mut reader = TarTilesReader::open(tar_path)?;
//! let tile_coord = TileCoord::new(1, 2, 3)?;
//! let tile = reader.tile(&tile_coord).await?;
//! if let Some(mut tile) = tile {
//! println!("Tile data: {:?}", tile.as_blob(&TileCompression::Uncompressed));
//! }
//!
//! // Writing to a tar archive
//! let output_path = Path::new("path/to/output.tar");
//! let runtime = TilesRuntime::default();
//! let mut writer = TarTilesWriter::write_to_path(
//! &mut reader,
//! output_path,
//! runtime
//! ).await?;
//!
//! Ok(())
//! }
//! ```
//!
//! The above example demonstrates how to read from an existing tar archive containing tile data
//! and how to write tile data to a new tar archive using `TarTilesReader` and `TarTilesWriter` respectively.
pub use TarTilesReader;
pub use TarTileSink;
pub use TarTilesWriter;