parse_paging_header

Function parse_paging_header 

Source
pub fn parse_paging_header<R: Read>(
    first: u64,
    r: &mut R,
) -> Result<(PagingKind, u64, u64)>
Expand description

Parse the paging handshake header after the caller has read the first u64. v2-only: the first u64 MUST be PAGING_MAGIC_V2, then [u8 kind][u64 arena_bytes][u64 blob_bytes]. blob_bytes == 0 = the RAW one-sided mode (per-connection arena, client-owned allocator — the caller routes it OFF the paging registry). Rejects unsupported kinds (≥2), the retired v1 magic (dedicated diagnostic so a stale binary fails legibly), and any other first u64 (e.g. a bare legacy total_bytes).