Skip to main content

open_record

Function open_record 

Source
pub fn open_record(
    bytes: &[u8],
    name: &str,
    state: &str,
) -> Result<Map<String, Value>, RecoveryError>
Expand description

What: Parse a record’s bytes into its object after checking schema version and state. Returns the parsed object; the caller builds a reader over it. Why: The incumbent’s openRecord: fatal UTF-8, a JSON object, version 2, the expected state; anything else fails with the record named.

In TS you’d write (pseudocode):

function openRecord({ bytes, name, state }): RecordReader;