Struct serde_json::builder::ObjectBuilder
[−]
[src]
pub struct ObjectBuilder { /* fields omitted */ }
This structure provides a simple interface for constructing a JSON object.
Methods
impl ObjectBuilder
[src]
fn new() -> ObjectBuilder
Construct an ObjectBuilder
.
fn build(self) -> Value
Return the constructed Value
.
fn insert<S, V>(self, key: S, value: V) -> ObjectBuilder where S: Into<String>, V: Serialize
Insert a key-value pair into the object.
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.
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.
Trait Implementations
impl Default for ObjectBuilder
[src]
fn default() -> ObjectBuilder
Returns the "default value" for a type. Read more