structio 0.2.0
Writing a document after what a buffer already holds, in JSON as well as BEVE, and a buffer that survives a panic out of the value being written.
[dependencies]
structio = "0.2"Added
json::append(&T, &mut Vec<u8>)writes a document after what a buffer already holds, the counterpart ofbeve::append.write_intoreplaces a buffer's contents, so a value that has to sit behind a protocol header, or behind the entries already in a listing, needed a second buffer and a copy out of it.json::Writer::appendingis the same thing with the writer in hand.
Changed
json::append,beve::appendandbeve::append_alignedleave the buffer exactly as they found it if writing the value panics. The buffer moves into the writer, so an unwind used to drop it along with the bytes in front of the document. AWriteimpl may panic by design: an adapter whose target has values it cannot encode is told to substitute or panic.write_intostill leaves its buffer empty there, its contents being the call's to replace, and now says so.json::Writer::into_stringchecks the bytes handed toWriter::appending, and panics if they are not UTF-8. Every other byte in the buffer is UTF-8 by construction; those are the only ones the writer did not produce. Useinto_vecto append JSON behind a binary prefix.
The full list is in CHANGELOG.md.