Struct json_event_parser::JsonWriter[][src]

pub struct JsonWriter<W: Write> { /* fields omitted */ }
Expand description

A simple JSON streaming writer.

use json_event_parser::{JsonWriter, JsonEvent};

let mut buffer = Vec::new();
let mut writer = JsonWriter::from_writer(&mut buffer);
writer.write_event(JsonEvent::StartObject)?;
writer.write_event(JsonEvent::ObjectKey("foo"))?;
writer.write_event(JsonEvent::Number("1"))?;
writer.write_event(JsonEvent::EndObject)?;

assert_eq!(buffer.as_slice(), b"{\"foo\":1}");

Implementations

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.