[][src]Module nobility::bin_encode

Contains the implementation of the binary format encoder. Encoder for the NBT binary format. This is based on builder objects rather than taking a document structure, so very few allocations are required other than the actual data buffer being written into.

Example

use nobility::bin_encode::NbtWriter;

let mut writer = NbtWriter::new();

let mut root = writer.root("hello world");
root.field("name").string("Bananrama");
// finish() call is required.
root.finish();

let result: Vec<u8> = writer.finish();

Structs

CompoundListWriter

A builder for a TAG_List of TAG_Compounds.

CompoundWriter

A builder for a TAG_Compound, allowing fields to be added sequentially.

NbtWriter

This object owns the buffer that the NBT is being written into. It represents one document.

TagWriter

A builder for creating NBT tags. This is created using CompoundWriter::field.