ptwm_core
ptwm_core::header
v1 PTWM wire-format header.
ptwm_core::header
v1 PTWM wire-format header.
ptwm_core::header
crates/ptwm-core/src/header.rs:1mod headerv1 PTWM wire-format header.
Layout (little-endian):
```text
magic: [u8; 9] \x89PTWM\r\n\x1a\n or \x89PTWX\r\n\x1a\n
flags: u16 bit 0 = .ptwx (has embedded WASM)
extension_table_offset: u64 0 ⇒ no extensions referenced
extension_table_length: u64
extension_table_hash: [u8; 32] blake3 of serialized table
tensor_index_offset: u64
tensor_index_length: u64
shared_prelude_offset: u64
shared_prelude_length: u64
```
Fixed size: 9 + 2 + 8 + 8 + 32 + 8 + 8 + 8 + 8 = 91 bytes.
ptwm_core::header::ContainerMagic
crates/ptwm-core/src/header.rs:34pub enum ContainerMagicContainer kind named by the first 9 bytes of a file.
ptwm_core::header::FLAG_PTWX
crates/ptwm-core/src/header.rs:30pub const FLAG_PTWXptwm_core::header::Header
crates/ptwm-core/src/header.rs:58pub struct Headerptwm_core::header::HEADER_LEN
crates/ptwm-core/src/header.rs:55pub const HEADER_LENptwm_core::header::MAGIC_PTWC
crates/ptwm-core/src/header.rs:28pub const MAGIC_PTWCMagic of the compact container (`ContainerLayout::Compact`). Readers that predate it fail [`Header::read`] with "bad magic".
ptwm_core::header::MAGIC_PTWM
crates/ptwm-core/src/header.rs:23pub const MAGIC_PTWMptwm_core::header::MAGIC_PTWX
crates/ptwm-core/src/header.rs:24pub const MAGIC_PTWXptwm_core::header::sniff
crates/ptwm-core/src/header.rs:45pub fn sniff(buf: &[u8]) -> Option<ContainerMagic>Identify the container magic at the start of `buf`, or `None` when `buf` does not start with one of the three 9-byte container magics.