Struct nu_json::builder::ObjectBuilder [−][src]
pub struct ObjectBuilder { /* fields omitted */ }
Expand description
This structure provides a simple interface for constructing a JSON object.
Implementations
Construct an ObjectBuilder
.
Insert a key-value pair into the object.
pub fn insert_array<S, F>(self, key: S, f: F) -> ObjectBuilder where
S: Into<String>,
F: FnOnce(ArrayBuilder) -> ArrayBuilder,
pub fn insert_array<S, F>(self, key: S, f: F) -> ObjectBuilder where
S: Into<String>,
F: FnOnce(ArrayBuilder) -> ArrayBuilder,
Creates and passes an ObjectBuilder
into a closure, then inserts the resulting array into
this object.
pub fn insert_object<S, F>(self, key: S, f: F) -> ObjectBuilder where
S: Into<String>,
F: FnOnce(ObjectBuilder) -> ObjectBuilder,
pub fn insert_object<S, F>(self, key: S, f: F) -> ObjectBuilder where
S: Into<String>,
F: FnOnce(ObjectBuilder) -> ObjectBuilder,
Creates and passes an ObjectBuilder
into a closure, then inserts the resulting object into
this object.