Module quartz_nbt::serde[][src]

Expand description

When the serde feature is enabled, this module provides Serializer and Deserializer implementations to link this crate into the serde data model.

Structs

A transparent wrapper around sequential types to allow the NBT serializer to automatically select an appropriate array type, favoring specialized array types like IntArray and ByteArray. Currently this type can only wrap vectors, however tuples may be supported in the future.

The deserializer type for reading binary NBT data.

This struct serves as a transparent wrapper around other sealed types to allow for blanket implementations of Serialize.

Functions

Deserializes the given type from binary NBT data. The NBT data must start with a compound tag and represent the type T correctly, else the deserializer will return with an error.

Deserializes the given type from binary NBT data read from the given reader. The NBT data must start with a compound tag and represent the type T correctly, else the deserializer will return with an error.

Serializes the given value as binary NBT data, returning the resulting Vec. The value must be a struct or non-unit enum variant, else the serializer will return with an error.

Serializes the given value as binary NBT data, writing to the given writer. The value must be a struct or non-unit enum variant, else the serializer will return with an error.

Similar to serialize_into, but elides checks for homogeneity on sequential types. This means that there are some T for which this method will write invalid NBT data to the given writer.

Similar to serialize, but elides homogeneity checks on sequential types. This means that there are some T for which this method will return invalid NBT data.

Type Definitions

The serializer type for writing binary NBT data.

An alternative serializer type for writing binary NBT data which elides checks for sequence homogeneity. Using this type could result in bogus NBT data.