Skip to main content

encode_persisted_entry

Function encode_persisted_entry 

Source
pub fn encode_persisted_entry(
    context: PersistContext,
    payload: &[u8],
    cipher: Option<&AesCipher>,
) -> Result<Vec<u8>, CachePersistError>
Expand description

Frame an already-bincode-serialized payload using the MLCP layout. Both the async worker and the synchronous maintenance helper call this — the on-disk format is unified across both paths (REM-002 §18.2). The payload is encrypted (or left as plaintext) before framing; the magic / version / table / schema / generation / key / payload_len / CRC32C layout is the same for both encrypted and plaintext frames.