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:
Format | Doc | Feature |
---|---|---|
MessagePack | Binary format with small output size | msgpack |
JSON | Human-readable text format | json |
TOML | Human-readable configuration format | toml |
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§
- Serialization
Error - Represents potential serialisation errors.
- Serialization
Format - 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
usingformat
intoT
. - 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 aVec<u8>
. - serialize_
json - Attempts to serialise
subject
into JSON and returns the string as aVec<u8>
. - serialize_
messagepack - Attempts to serialise
subject
intoMessagePack
and returns as aVec<u8>
. - serialize_
to - A simple wrapper function that calls
serialize
and writes the result towriter
. - serialize_
toml - Attempts to serialise
subject
intoTOML
and returns the string as aVec<u8>
.