Skip to main content

MappedFttsq

Struct MappedFttsq 

Source
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

Source

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.

Source

pub fn absent_sections(&self) -> &[String]

Sections this artifact’s bytes stop short of; empty for a whole-file load.

Source

pub fn has_section(&self, name: &str) -> bool

Whether a named section’s bytes are actually held.

Source

pub const fn reader(&self) -> &FttsqReader

The fully validated directory over this artifact.

Source

pub fn page_advice(&self) -> &[PageAdviceApplication]

The policy application record, in the same priority order as page_in_plan.

Source

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.

Source

pub fn len(&self) -> usize

The artifact’s mapped (or fallback-owned) byte length.

Source

pub fn is_empty(&self) -> bool

Whether this artifact is empty.

Trait Implementations§

Source§

impl Debug for MappedFttsq

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.