Crate serialization

Source
Expand description

§DungeonRS serialization

This crate handles serialisation from and to binary representations. It’s essentially a wrapper around Serde using various formats depending on the enabled features.

These are the currently supported features:

FormatDocFeature
MessagePackBinary format with small output sizemsgpack
JSONHuman-readable text formatjson
TOMLHuman-readable configuration formattoml

Modules§

deserialize 🔒
Provides all deserialisation related methods and their respective formats.
error 🔒
Contains all errors defined and used by the serialization crate.
format 🔒
Contains the formats the serialization crate makes available.
serialize 🔒
Provides all serialisation related methods and their respective formats.

Enums§

SerializationError
Represents potential serialisation errors.
SerializationFormat
Available serialisation formats.

Traits§

Deserialize
A data structure that can be deserialized from any data format supported by Serde.
Serialize
A data structure that can be serialized into any data format supported by Serde.

Functions§

deserialize
Attempts to deserialise subject using format into T.
deserialize_json
Attempts to deserialize subject using JSON.
deserialize_messagepack
Attempts to deserialize subject using MessagePack.
deserialize_toml
Attempts to deserialize subject using TOML.
serialize
Attempts to serialise subject into the specified format and returns the result as a Vec<u8>.
serialize_json
Attempts to serialise subject into JSON and returns the string as a Vec<u8>.
serialize_messagepack
Attempts to serialise subject into MessagePack and returns as a Vec<u8>.
serialize_to
A simple wrapper function that calls serialize and writes the result to writer.
serialize_toml
Attempts to serialise subject into TOML and returns the string as a Vec<u8>.

Derive Macros§

Deserialize
Serialize