pub struct MappedFttsq { /* private fields */ }Expand description
A fully verified .fttsq held as a read-only mapping (or the safe owned-byte fallback).
The mapping owns the bytes while FttsqReader owns only the validated directory, so tensor
views borrow the artifact rather than duplicating multi-gigabyte payloads. The loader validates
the directory’s structure and ranges, applies bounded OS advice, then verifies every digest
before returning. That ordering lets MADV_WILLNEED begin while validation runs; the mapping is
never exposed to callers until the hardened reader has accepted every section digest.
Implementations§
Source§impl MappedFttsq
impl MappedFttsq
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self, FttsqError>
pub fn open(path: impl AsRef<Path>) -> Result<Self, FttsqError>
Map, fully validate, and apply the access-class page-in plan to an artifact.
The integrity check remains eager because the v1 format carries a digest per section rather
than a per-page Merkle tree. Consequently, this loader establishes a policy guarantee —
the cold embedding is never sent MADV_WILLNEED — and records the pre-digest residency
measurement, not a claim that opening v1 avoids every cold-section page fault. A
page-granular integrity format is required before that stronger claim can be made honestly.
§Errors
Returns a named FttsqError for mapping, structural, or digest-validation failures.
Sourcepub fn absent_sections(&self) -> &[String]
pub fn absent_sections(&self) -> &[String]
Sections this artifact’s bytes stop short of; empty for a whole-file load.
Sourcepub fn has_section(&self, name: &str) -> bool
pub fn has_section(&self, name: &str) -> bool
Whether a named section’s bytes are actually held.
Sourcepub const fn reader(&self) -> &FttsqReader
pub const fn reader(&self) -> &FttsqReader
The fully validated directory over this artifact.
Sourcepub fn page_advice(&self) -> &[PageAdviceApplication]
pub fn page_advice(&self) -> &[PageAdviceApplication]
The policy application record, in the same priority order as page_in_plan.
Sourcepub fn tensor_bytes(&self, name: &str) -> Result<&[u8], FttsqError>
pub fn tensor_bytes(&self, name: &str) -> Result<&[u8], FttsqError>
Borrow one tensor’s logical bytes without copying the mapped payload.
§Errors
Returns the same named lookup/range errors as FttsqReader::tensor_bytes.