Skip to main content

decode_record

Function decode_record 

Source
pub fn decode_record(
    payload: &[u8],
    encoding: TextEncoding,
) -> Result<Vec<SqliteValue>>
Expand description

Decode one record into its values.

payload must be the whole record, overflow pages already stitched back on. Anything that does not add up, a header that overruns the payload, a value that runs past the end, a reserved serial type, is a malformed file and comes back as an error.

encoding is the one the database header states, and it applies to every text value in the file. Text comes back as a Rust String whatever the file stores, so the encoding is a fact about the bytes on disk and not something callers have to carry around afterwards.