Skip to main content

PackedReader

Struct PackedReader 

Source
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

Source

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.

Source

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.

Source

pub fn entries(&self) -> &[TileEntry]

All directory entries (sorted by zoom then Hilbert index).

Source

pub fn metadata(&self) -> &Metadata

Dataset metadata.

Source

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.

Source

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.

Source

pub fn read_layers(&self, entry: &TileEntry) -> Result<Vec<DecodedLayer>>

Read and decode a tile into its Arrow layers.

Source

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.

Source

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.

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool