ptwm_core::ptwc
ptwm_core::ptwc
Sections of the compact container (\x89PTWC): header, chain registry, index and footer. crate::container writes and reads whole files; crate::extension::compact_table and crate::tensor_record_compact hold the Extension Table and record codecs.
ptwm_core::ptwc
crates/ptwm-core/src/ptwc.rs:1mod ptwcSections of the compact container (`\x89PTWC`): header, chain registry, index and footer. [`crate::container`] writes and reads whole files; [`crate::extension::compact_table`] and [`crate::tensor_record_compact`] hold the Extension Table and record codecs.
ptwm_core::ptwc::FOOTER_LEN
crates/ptwm-core/src/ptwc.rs:66pub const FOOTER_LENFooter size: `index_len` and the EOF sentinel.
ptwm_core::ptwc::header_bytes
crates/ptwm-core/src/ptwc.rs:75pub fn header_bytes(et: &[u8], prelude: &[u8], registry: &[u8]) -> Vec<u8>Serialize the header for sections of the given bytes.
ptwm_core::ptwc::locate_sections
crates/ptwm-core/src/ptwc.rs:105pub fn locate_sections(buf: &[u8]) -> Result<Sections, PtwmCoreError>Locate and check the sections of a compact container: magic, `hflags`, section lengths, footer, and `meta_xxh64`. The caller checks the EOF sentinel first.
ptwm_core::ptwc::MAX_NAME_LEN
crates/ptwm-core/src/ptwc.rs:68pub const MAX_NAME_LENLongest tensor name.
ptwm_core::ptwc::read_index
crates/ptwm-core/src/ptwc.rs:251pub fn read_index(buf: &[u8], body: Range<usize>) -> Result<Vec<IndexEntry>, PtwmCoreError>Parse the index of a body at `body` (absolute range). Returns entries sorted by `(name_hash, name)` with absolute offsets; their names are set.
ptwm_core::ptwc::read_registry
crates/ptwm-core/src/ptwc.rs:193pub fn read_registry(buf: &[u8], table: &ExtensionTable) -> Result<ChainRegistry, PtwmCoreError>Parse a chain registry that fills `buf` exactly. Op references resolve through `table`, whose entry must be a built-in transform.
ptwm_core::ptwc::Sections
crates/ptwm-core/src/ptwc.rs:93pub struct SectionsByte ranges of each section of a compact container.
ptwm_core::ptwc::write_index
crates/ptwm-core/src/ptwc.rs:229pub fn write_index(entries: &[(String, u64)]) -> Result<Vec<u8>, PtwmCoreError>Encode the index for `(name, record length)` pairs in body order.
ptwm_core::ptwc::write_registry
crates/ptwm-core/src/ptwc.rs:163pub fn write_registry(registry: &ChainRegistry, op_index: impl ?) -> Result<Vec<u8>, PtwmCoreError>Encode the chain registry. Chain ids must equal their positions; a Source node with empty params is written as a bound Source. `op_index` maps an op to its Extension Table index.