[][src]Crate fastnbt

fastnbt aims for fast parsing of NBT data from Minecraft: Java Edition. This format is used to store many things in Minecraft.

A serde compatible deserializer can be found in the de module. This deserialiser works on an in-memory &[u8], meaning you need all of the NBT data in memory. This has the advantage of allowing you to avoid memory allocations in some cases. See the de module for more information.

If you require processing a large amount of NBT data that you do not want to keep in memory, or NBT data that you do not know the structure of, you can use the Parser. This does not allow you to deserialize into Rust structs, but does allow low memory footprint processing on NBT data.

Both this and related crates are under one fastnbt Github repository

Modules

de

A conventional serde deserializer module.

error

Structs

PackedBits

PackedBits can be used in place of blockstates in chunks to avoid allocating memory for them when they might not be needed. This object by default just retains a reference to the data in the input, and unpack_into can be used to get the unpacked version when needed.

Parser

Parser can take any reader and parse it as NBT data. Does not do decompression.

Enums

Error
Tag

The NBT tag. This does not carry the value or the name.

Value

An NBT value.

Functions

bits_per_block

Get the number of bits that will be used in Blockstates per block.

dump
expand_blockstates

Expand blockstate data so each block is an element of a Vec.

expand_generic_1_15

Expand generic bit-packed data in the 1.15 format, ie data potentially existing across two 64-bit ints.

expand_generic_1_16

Expand generic bit-packed data in the 1.16 format, ie with padding bits.

expand_heightmap

Expand heightmap data. This is equivalent to expand_generic(data, 9).

find_compound
find_list
skip_compound

Type Definitions

Name
Result