Skip to main content

json_object

Function json_object 

Source
pub fn json_object(
    entries: impl IntoIterator<Item = (String, Option<Value>)>,
) -> Value
Expand description

Builds a JSON object from (key, value) pairs, skipping None values.

Emitters assemble a lot of optional fields; this keeps that readable without a builder type.