pub struct BundleReader<'a> { /* private fields */ }Expand description
A parsed, integrity-checked view over a .hmc bundle’s bytes. Borrows the
input; get/segment return slices into it (zero copy).
Implementations§
Source§impl<'a> BundleReader<'a>
impl<'a> BundleReader<'a>
Sourcepub fn parse_with_limits(
bytes: &'a [u8],
limits: BundleReadLimits,
) -> Result<Self, BundleError>
pub fn parse_with_limits( bytes: &'a [u8], limits: BundleReadLimits, ) -> Result<Self, BundleError>
Bounded cold admission for the current definite-length index encoding. Shared preflight borrows CBOR fields before cold materialization can allocate. Unknown fields, indefinite encodings and trailing index data require an explicit compatibility profile instead of implicit skipping. This verifies bytes and structure, not source rights or asset acceptance.
Sourcepub fn parse(bytes: &'a [u8]) -> Result<Self, BundleError>
pub fn parse(bytes: &'a [u8]) -> Result<Self, BundleError>
Parse and fully validate a bundle: magic, version, declared length,
whole-file CRC, and every entry’s bounds. On success the payloads are
known-good and in-bounds, so get/segment are total on valid keys.
Sourcepub fn entries(&self) -> &[BundleEntry]
pub fn entries(&self) -> &[BundleEntry]
The bundle’s entries (index order).
Sourcepub fn flags(&self) -> u16
pub fn flags(&self) -> u16
Reserved format flags from the header (0 in v1; reserved for future use such as a signed/compressed-entry variant).
Sourcepub fn is_page_aligned_4096(&self) -> bool
pub fn is_page_aligned_4096(&self) -> bool
True when the bundle header declares 4096-byte OS page alignment.
Sourcepub fn entry(&self, key: &str) -> Option<&BundleEntry>
pub fn entry(&self, key: &str) -> Option<&BundleEntry>
The index record for key, if present.
Sourcepub fn get(&self, key: &str) -> Option<&'a [u8]>
pub fn get(&self, key: &str) -> Option<&'a [u8]>
A zero-copy slice of the intact embedded file for key. This slice is
a byte-identical standalone .q42 / .10d / .p64 — hand it straight to
that format’s reader.
Sourcepub fn segment(
&self,
key: &str,
seg_offset: u64,
seg_len: u64,
) -> Option<&'a [u8]>
pub fn segment( &self, key: &str, seg_offset: u64, seg_len: u64, ) -> Option<&'a [u8]>
A zero-copy slice of an interior segment of an entry
([seg_offset .. seg_offset+seg_len) within the embedded file). Returns
None if the key is unknown or the segment runs past the entry — proving
the bundle does not interfere with segment-level access into an entry.
Sourcepub fn verify_entry(&self, key: &str) -> bool
pub fn verify_entry(&self, key: &str) -> bool
Verify one entry’s payload against its recorded SHA-256.
Sourcepub fn get_family_manifest(
&self,
) -> Result<Option<TwinFamilyManifest>, BundleError>
pub fn get_family_manifest( &self, ) -> Result<Option<TwinFamilyManifest>, BundleError>
Retrieve and decode the embedded digital twin family manifest, if present.
Sourcepub fn get_species_meta(
&self,
) -> Result<Option<HolisticSpeciesMeta>, BundleError>
pub fn get_species_meta( &self, ) -> Result<Option<HolisticSpeciesMeta>, BundleError>
Retrieve and decode the embedded holistic species metadata, if present.
Auto Trait Implementations§
impl<'a> Freeze for BundleReader<'a>
impl<'a> RefUnwindSafe for BundleReader<'a>
impl<'a> Send for BundleReader<'a>
impl<'a> Sync for BundleReader<'a>
impl<'a> Unpin for BundleReader<'a>
impl<'a> UnsafeUnpin for BundleReader<'a>
impl<'a> UnwindSafe for BundleReader<'a>
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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