Crates.io | fastnbt |
lib.rs | fastnbt |
version | 2.5.0 |
source | src |
created_at | 2020-05-24 14:45:10.546745 |
updated_at | 2024-03-02 11:55:09.005974 |
description | Serde deserializer for Minecraft's NBT format |
homepage | |
repository | https://github.com/owengage/fastnbt |
max_upload_size | |
id | 245240 |
size | 394,855 |
Documentation: docs.rs
Fast serde deserializer and serializer for Minecraft: Java Edition's NBT format.
Zero-copy is supported where possible through from_bytes
. The
borrow
module contains more types for avoiding allocations.
Includes a Value
type for serializing or deserializing any NBT. Value
correctly preserves the exact NBT structure. The nbt!
macro allows easy
creation of these values.
To support NBT's arrays, there are dedicated ByteArray
, IntArray
and
LongArray
types.
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:
serde::Serialize
to enable spitting out to other
data formats, but may change structure in future.Changes that make fastnbt
incompatible with WebAssembly are considered
breaking changes.
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.
fastnbt's Value
type 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!