Struct json_writer::JSONArrayWriter [−][src]
pub struct JSONArrayWriter<'a> {
pub buffer: &'a mut String,
// some fields omitted
}Expand description
Helper for appending a JSON array to the borrowed buffer.
Appends ‘[’ on creation. Appends ‘]’ when dropped.
Fields
buffer: &'a mut StringMutable borrow of buffer
Consider using the methods instead of using this field directly. This field should not be used unless you know what you are doing.
Implementations
Creates a new JSONArrayWriter that writes to the given buffer. Writes ‘[’ to the buffer immediately.
Starts writing a nested object as array entry.
Writes ‘{’ and returns a JSONObjectWriter
Starts writing a nested array as array entry.
Writes ‘[’ and returns a JSONArrayWriter
Writes given value as array entry
Writes a comma unless at the beginning of the array
Warning: If you use this method, you will have to write the value to the buffer youself afterwards.
Writes the entire buffer to given writer and clears entire buffer on success.
Returns buffer length in bytes
