Skip to main content

parse_bytes

Function parse_bytes 

Source
pub fn parse_bytes(bytes: &[u8], format: &str) -> Result<Parsed>
Expand description

Parse in-memory case bytes of the named format. Accepts every name parse_str does, plus pwb: PowerWorld binary has no text form, so this is the only in-memory entry point that reaches it. Text formats decode as UTF-8 and take the parse_str path from there.

A caller that already holds the file’s bytes — an upload, an archive member, a database blob — parses them here rather than staging a temporary file for parse_file.

§Errors

Error::UnknownFormat if format is unrecognized; Error::FormatRead if a text format’s bytes are not UTF-8; the reader’s own Error on malformed input.