Skip to main content

object

Function object 

Source
fn object(s: &str) -> Result<Vec<(&str, &str)>, String>
Expand description

Split a JSON object into its keys and the raw text of their values.

Not a JSON parser and not trying to be: it finds boundaries and hands back slices of the input, because the rows have to leave this process as the bytes that entered it. Every byte it is pointed at came out of api::envelope, so the shapes it refuses are the ones that say a replica is running a build this one does not understand — which is worth an error and not a guess.

ponytail: enough of a scanner to walk one envelope. It is not a general JSON reader and must not grow into one — if something here ever needs the values themselves, api::parse already reads JSON as the KYAML subset it is (principle 5), and the reason this does not use it is only that a round trip through Yaml would re-render the rows.