Struct nu_json::builder::ArrayBuilder
source · [−]pub struct ArrayBuilder { /* private fields */ }
Expand description
This structure provides a simple interface for constructing a JSON array.
Implementations
sourceimpl 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 where
F: FnOnce(ArrayBuilder) -> ArrayBuilder,
pub fn push_array<F>(self, f: F) -> ArrayBuilder where
F: FnOnce(ArrayBuilder) -> 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 where
F: FnOnce(ObjectBuilder) -> ObjectBuilder,
pub fn push_object<F>(self, f: F) -> ArrayBuilder where
F: FnOnce(ObjectBuilder) -> ObjectBuilder,
Creates and passes an ArrayBuilder
into a closure, then inserts the resulting object into
this array.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ArrayBuilder
impl Send for ArrayBuilder
impl Sync for ArrayBuilder
impl Unpin for ArrayBuilder
impl UnwindSafe for ArrayBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more