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 String

Mutable 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.

Drops the writer. Dropping causes ‘]’ to be appended to the buffer.

Writes the entire buffer to given writer and clears entire buffer on success.

Returns buffer length in bytes

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.