Skip to main content

Crate nbtx

Crate nbtx 

Source
Expand description

Implements NBT serialisation and deserialization for three different integer encodings.

Re-exports§

pub use snbt::from_string;snbt
pub use snbt::to_string;snbt

Modules§

snbtsnbt
Implements stringified NBT support. This is the human-readable NBT format that is often used in Minecraft commands.

Structs§

Deserializer
NBT deserializer. Rather than using this directly you should probably use one of the methods provided in the root, such as from_le_bytes.
Serializer
NBT data serializer.

Enums§

BigEndian
Defines big-endian serialization.
Error
Errors that can occur while serializing or deserializing NBT data.
FieldType
NBT field type
LittleEndian
Defines little-endian serialization.
NetworkLittleEndian
Used by Bedrock for NBT transferred over the network. This format is the same as LittleEndian, except that type lengths (such as for strings or lists), are varints instead of shorts. The integer and long types are also varints.
Value
General NBT value type that can represent any value.
Variant
NBT format variant.

Traits§

EndiannessImpl
Implemented by all NBT variants.

Functions§

from_be_bytes
Reads a single object of type T from the given buffer.
from_bytes
Reads a single object of type T from the given buffer.
from_le_bytes
Reads a single object of type T from the given buffer.
from_net_bytes
Reads a single object of type T from the given buffer.
to_be_bytes
Serializes the given data in big endian format.
to_be_bytes_in
Serializes the given data in big endian format.
to_bytes
Serializes the given data in any endian format.
to_bytes_in
Serializes the given data in any endian format.
to_le_bytes
Serializes the given data in little endian format.
to_le_bytes_in
Serializes the given data in little endian format.
to_net_bytes
Serializes the given data in network little endian format.
to_net_bytes_in
Serializes the given data in network little endian format.

Type Aliases§

Result
Convenient type definition for Result<T, nbtx::Error>.