pub struct ArrayBuilder { /* private fields */ }
Expand description
This structure provides a simple interface for constructing a JSON array.
Implementations§
Source§impl ArrayBuilder
impl ArrayBuilder
Sourcepub fn new() -> ArrayBuilder
pub fn new() -> ArrayBuilder
Construct an ObjectBuilder
.
Sourcepub fn push<T: Serialize>(self, v: T) -> ArrayBuilder
pub fn push<T: Serialize>(self, v: T) -> ArrayBuilder
Insert a value into the array.
Sourcepub fn push_array<F>(self, f: F) -> ArrayBuilder
pub fn push_array<F>(self, f: F) -> ArrayBuilder
Creates and passes an ArrayBuilder
into a closure, then inserts the resulting array into
this array.
Sourcepub fn push_object<F>(self, f: F) -> ArrayBuilder
pub fn push_object<F>(self, f: F) -> ArrayBuilder
Creates and passes an ArrayBuilder
into a closure, then inserts the resulting object into
this array.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ArrayBuilder
impl RefUnwindSafe for ArrayBuilder
impl Send for ArrayBuilder
impl Sync for ArrayBuilder
impl Unpin for ArrayBuilder
impl UnwindSafe for ArrayBuilder
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