pub struct PackedReader { /* private fields */ }Expand description
Reader for a local packed dataset. Remote/HTTP reads are the TS reader’s job; this opens objects from the filesystem.
Mirrors ArchiveReader: entries returns
the decoded v5 directory, metadata the folded metadata,
and read_payload selects the entry’s pack, slices
[offset..offset+length], verifies CRC32C and decompresses the per-blob
zstd. Packs are mmap’d lazily by pack_id.
Implementations§
Source§impl PackedReader
impl PackedReader
Sourcepub fn open<P: AsRef<Path>>(manifest_path: P) -> Result<Self>
pub fn open<P: AsRef<Path>>(manifest_path: P) -> Result<Self>
Open a packed dataset by its manifest.json path. The directory and pack
objects are resolved relative to the manifest’s parent directory.
Sourcepub fn open_bundle<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn open_bundle<P: AsRef<Path>>(path: P) -> Result<Self>
Open a single-file .sttb bundle (spec §13, the interchange
profile). The bundle is mmap’d once; the manifest comes verbatim from
the header, each pack becomes an (offset, length) window into the
mapping, and everything below read_payload is
shared with the exploded-directory open path —
including the manifest format/version/capability refusals.
Sourcepub fn entries(&self) -> &[TileEntry]
pub fn entries(&self) -> &[TileEntry]
All directory entries (sorted by zoom then Hilbert index).
Sourcepub fn capabilities(&self) -> &[String]
pub fn capabilities(&self) -> &[String]
The manifest’s capabilities declarations (spec §3.1). A tool that
repacks this dataset’s tiles verbatim MUST carry these forward via
PackWriter::with_capabilities — dropping them re-arms the
silent-misdecode hazard the declaration exists to prevent.
Sourcepub fn read_payload(&self, entry: &TileEntry) -> Result<Vec<u8>>
pub fn read_payload(&self, entry: &TileEntry) -> Result<Vec<u8>>
Read and decompress a tile’s raw payload bytes, verifying its CRC32C.
Selects the pack by entry.pack_id, slices [offset..offset+length]
within it, checks the CRC, then decompresses the per-blob zstd. Mirrors
ArchiveReader::read_payload.
Sourcepub fn read_layers(&self, entry: &TileEntry) -> Result<Vec<DecodedLayer>>
pub fn read_layers(&self, entry: &TileEntry) -> Result<Vec<DecodedLayer>>
Read and decode a tile into its Arrow layers.
Sourcepub fn decode_payload(&self, payload: &[u8]) -> Result<Vec<DecodedLayer>>
pub fn decode_payload(&self, payload: &[u8]) -> Result<Vec<DecodedLayer>>
Decode a tile payload under this dataset’s declared formatVersion.
The manifest is authoritative (design §1 ★F6): a v2 frame inside a v1-declared dataset is a hard error, and vice versa — never a silent best-effort decode of a mixed-version dataset. v2 frames resolve their template references through the registry built at open.
Sourcepub fn format_version(&self) -> u32
pub fn format_version(&self) -> u32
The manifest’s authoritative formatVersion (1 | 2). A tool that
repacks this dataset’s payloads verbatim MUST write the same version
(PackWriter::with_format_version) — frames and manifest declarations
may not mix.
Sourcepub fn templates(&self) -> Option<&TemplateRegistry>
pub fn templates(&self) -> Option<&TemplateRegistry>
The v2 schema-template registry decoded from manifest.schemas
(None on v1 datasets). Exposed so tools that fetch payloads through
read_payload can decode them out-of-band via
crate::arrow_tile::decode_tile_with_templates.
Auto Trait Implementations§
impl !RefUnwindSafe for PackedReader
impl !Sync for PackedReader
impl Freeze for PackedReader
impl Send for PackedReader
impl Unpin for PackedReader
impl UnsafeUnpin for PackedReader
impl UnwindSafe for PackedReader
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 more