Skip to main content

parse_object_literal

Function parse_object_literal 

Source
pub fn parse_object_literal(
    s: &str,
) -> Option<Result<HashMap<String, Value>, String>>
Expand description

Parse a { key: value, ... } object literal into a field map.

Returns None if the input doesn’t start with { (not an object literal). Returns Some(Err(msg)) on parse errors (malformed object literal). Returns Some(Ok(fields)) on success.