pub fn from_json<'segments>(
json: &str,
builder: impl Into<Builder<'segments>>,
) -> Result<()>Expand description
Decode a JSON string into a Cap’n Proto struct builder.
builder accepts anything that converts into a capnp::dynamic_value::Builder;
the top-level value must be a struct builder, since JSON objects map to
Cap’n Proto structs. The fields and annotations supported are the same as
in to_json.
Returns an error if json is malformed, if the top-level JSON value is
not an object, or if any field’s value cannot be coerced to its declared
Cap’n Proto type.