Skip to main content

FttsqStreamPlan

Struct FttsqStreamPlan 

Source
pub struct FttsqStreamPlan { /* private fields */ }
Expand description

Metadata and fixed section lengths for a bounded .fttsq conversion.

A converter learns every tensor’s shape, storage policy, section, and final byte length from the validated input manifest before it starts payload conversion. That lets this plan reserve the directory first, then stream one section at a time into a caller-owned seekable temporary file. The writer never retains a payload section, and does not create, rename, or remove files: the caller owns the atomic-temp-file policy around it.

Implementations§

Source§

impl FttsqStreamPlan

Source

pub fn new( model_family: impl Into<String>, source_sha256: impl Into<String>, ) -> Self

Starts a bounded conversion plan for one model family and source checkpoint.

Source

pub fn license_notice(self, notice: impl Into<String>) -> Self

Sets the required Apache-2.0 §4 attribution notice.

Source

pub fn model_config(self, config: Value) -> Self

Attaches the frozen upstream model configuration.

Source

pub fn quantization_manifest(self, manifest: Value) -> Self

Attaches the policy used to quantize each tensor.

Source

pub fn section( self, name: impl Into<String>, access_class: AccessClass, length: u64, ) -> Self

Declares a section’s final byte length before its bytes are streamed.

Source

pub fn tensor(self, tensor: TensorEntry) -> Self

Declares a tensor located in one of the planned sections.

Source

pub fn begin<W: Write + Seek>( self, writer: W, ) -> Result<FttsqStreamingWriter<W>, FttsqError>

Writes the header and reserved directory into a caller-owned seekable stream.

Payload sections must subsequently be supplied in declaration order through FttsqStreamingWriter::write_section. A caller that needs an atomic artifact should provide its own same-filesystem temporary file, call FttsqStreamingWriter::finish, sync it, and rename it only after this method has finalized the directory.

§Errors

Refuses malformed planned metadata before writing any bytes, and names I/O failures from the caller’s stream without assuming a path or filesystem policy.

Trait Implementations§

Source§

impl Debug for FttsqStreamPlan

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.