PTWM
ptwm_core

ptwm_core::header

v1 PTWM wire-format header.

ptwm_core::header

v1 PTWM wire-format header.

rsmod

ptwm_core::header

crates/ptwm-core/src/header.rs:1
mod header

v1 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.
rstype

ptwm_core::header::ContainerMagic

crates/ptwm-core/src/header.rs:34
pub enum ContainerMagic

Container kind named by the first 9 bytes of a file.

rsconst

ptwm_core::header::FLAG_PTWX

crates/ptwm-core/src/header.rs:30
pub const FLAG_PTWX
rstype

ptwm_core::header::Header

crates/ptwm-core/src/header.rs:58
pub struct Header
rsconst

ptwm_core::header::HEADER_LEN

crates/ptwm-core/src/header.rs:55
pub const HEADER_LEN
rsconst

ptwm_core::header::MAGIC_PTWC

crates/ptwm-core/src/header.rs:28
pub const MAGIC_PTWC

Magic of the compact container (`ContainerLayout::Compact`). Readers that predate it fail [`Header::read`] with "bad magic".

rsconst

ptwm_core::header::MAGIC_PTWM

crates/ptwm-core/src/header.rs:23
pub const MAGIC_PTWM
rsconst

ptwm_core::header::MAGIC_PTWX

crates/ptwm-core/src/header.rs:24
pub const MAGIC_PTWX
rsfn

ptwm_core::header::sniff

crates/ptwm-core/src/header.rs:45
pub 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.