pub fn write_compound_tag<W: Write>(
writer: &mut W,
compound_tag: &CompoundTag,
) -> Result<(), Error>
Expand description
Write a compound tag to writer.
ยงExample
use nbt::encode::write_compound_tag;
use nbt::CompoundTag;
let mut server = CompoundTag::new();
server.insert_str("ip", "localhost:25565");
server.insert_str("name", "Minecraft Server");
server.insert_bool("hideAddress", true);
let mut servers = Vec::new();
servers.push(server);
let mut root_tag = CompoundTag::new();
root_tag.insert_compound_tag_vec("servers", servers);
let mut vec = Vec::new();
write_compound_tag(&mut vec, &root_tag).unwrap();