azalea/azalea-nbt
2023-03-22 19:31:28 -05:00
..
benches make nbt code more readable and add comparison benchmark 2023-03-22 19:31:28 -05:00
src make nbt code more readable and add comparison benchmark 2023-03-22 19:31:28 -05:00
tests optimize nbt lists 2023-03-22 19:52:19 +00:00
Cargo.toml make nbt code more readable and add comparison benchmark 2023-03-22 19:31:28 -05:00
README.md make nbt code more readable and add comparison benchmark 2023-03-22 19:31:28 -05:00

Azalea NBT

A fast NBT serializer and deserializer.

Note: Running your code with RUSTFLAGS="-C target-cpu=native" will result in significant performance improvements.

Examples

use ahash::AHashMap;
use azalea_nbt::Tag;
use std::io::Cursor;

let buf = include_bytes!("../tests/hello_world.nbt");
let tag = Tag::read(&mut Cursor::new(&buf[..])).unwrap();
assert_eq!(
    tag,
    Tag::Compound(AHashMap::from_iter(vec![(
        "hello world".into(),
        Tag::Compound(AHashMap::from_iter(vec![(
            "name".into(),
            Tag::String("Bananrama".into()),
        )]))
    )]))
);