Function valence::nbt::to_binary

pub fn to_binary<W, S, R>(
    comp: &Compound<S>,
    writer: W,
    root_name: &R,
) -> Result<(), Error>
where W: Write, S: ToModifiedUtf8 + Hash + Ord, R: ToModifiedUtf8 + ?Sized,
Expand description

Encodes uncompressed NBT binary data to the provided writer.

Only compounds are permitted at the top level. This is why the function accepts a Compound reference rather than a Value.

Additionally, the root compound can be given a name. Typically the empty string "" is used.