39 releases (19 stable)
|2.4.4||Apr 29, 2023|
|2.4.3||Mar 4, 2023|
|2.4.2||Feb 27, 2023|
|2.3.2||Aug 17, 2022|
|0.6.0||Jul 15, 2020|
#83 in Encoding
1,723 downloads per month
Used in 18 crates (16 directly)
Fast serde deserializer and serializer for Minecraft: Java Edition's NBT format.
Zero-copy is supported where possible through
borrow module contains more types for avoiding allocations.
Value type for serializing or deserializing any NBT.
correctly preserves the exact NBT structure. The
nbt! macro allows easy
creation of these values.
To support NBT's arrays, there are dedicated
See the documentation for more information.
[dependencies] fastnbt = "2"
fastnbt follows Semver, some things that this project does not count as a
breaking change are:
- Minimum Rust version change. Outside of corporate environments this should not be too difficult, and I don't see much need for NBT in those environments.
- Improving the (de)serializer such that valid NBT that did not (de)serialize, then (de)serializes. Any of these cases I consider a bug.
- Data format when serializing types from fastnbt/fastanvil to other formats.
Types in fastnbt implement
serde::Serializeto enable spitting out to other data formats, but may change structure in future.
Changes that make
fastnbt incompatible with WebAssembly are considered
Other NBT crates
There appears to be a few crates that support serde (de)serialization, the main ones I found were:
There are likely others! There are definitely more without serde support.
All these crates support serialization and deserialization with serde.
They are not interoperable with each other due to requiring custom handling of NBT Array types.
They all handle Minecraft's (actually Java's) specialized Unicode.
quartz and fastnbt support borrowing from the underlying bytes being deserialized.
Valuetype can round-trip deserialize-serialize NBT arrays. The other crates have value types as well, they may also round-trip correctly.
Honestly, they all seem like good options!