pub struct ObjectBuilder { /* private fields */ }
Expand description
This structure provides a simple interface for constructing a JSON object.
Implementations§
Source§impl ObjectBuilder
impl ObjectBuilder
Sourcepub fn new() -> ObjectBuilder
pub fn new() -> ObjectBuilder
Construct an ObjectBuilder
.
Sourcepub fn insert<S, V>(self, key: S, value: V) -> ObjectBuilder
pub fn insert<S, V>(self, key: S, value: V) -> ObjectBuilder
Insert a key-value pair into the object.
Sourcepub fn insert_array<S, F>(self, key: S, f: F) -> ObjectBuilder
pub fn insert_array<S, F>(self, key: S, f: F) -> ObjectBuilder
Creates and passes an ObjectBuilder
into a closure, then inserts the resulting array into
this object.
Sourcepub fn insert_object<S, F>(self, key: S, f: F) -> ObjectBuilder
pub fn insert_object<S, F>(self, key: S, f: F) -> ObjectBuilder
Creates and passes an ObjectBuilder
into a closure, then inserts the resulting object into
this object.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ObjectBuilder
impl RefUnwindSafe for ObjectBuilder
impl Send for ObjectBuilder
impl Sync for ObjectBuilder
impl Unpin for ObjectBuilder
impl UnwindSafe for ObjectBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more