Expand description
Visitor is a tree-based serializer/deserializer with intermediate representation for stored data. When data is serialized, it will be transformed into an intermediate representation and only then will be dumped onto the disk. Deserialization is the same: the data (binary or text) is read and converted into an intermediate representation (IR). End users can use this IR to save or load their structures of pretty much any complexity.
§Overview
Visitor uses a tree to create structured data storage. Basic unit is a node - it is a container for data fields. Each node has a name, handle to parent, set of handles to children nodes and a container for data fields. Data field is a pair of a name and a value, the value can be any of simple Rust types and some of the trivially copyable data structures (vectors, matrices, etc.). The main criteria of what could be the field and what not is the ability to be represented as a set of bytes.
See Visitor docs for more info.
Modules§
- blackboard
- Blackboard is a container for arbitrary, shared data that is available during serialization and
deserialization. See
Blackboarddocs for more info. - error
- Possible errors that may occur during serialization/deserialization.
- field
- A set fundamental data types.
- pod
- Data types that can be serialized as-is, by dumping the memory into a file.
- prelude
- Types to use
#[derive(Visit)]
Structs§
- Binary
Blob - Proxy struct for plain data. It is used to serialize arrays of trivially copyable data (
Vec<u8>) directly as a large chunk of data. For example, an attempt to serializeVec<u8>serialize each byte as a separate node which is very inefficient. - Region
Guard - A RegionGuard is a Visitor wrapper that automatically leaves the current region when it is dropped.
- Visitor
- Visitor is a tree-based serializer/deserializer with intermediate representation for stored data. When data is serialized, it will be transformed into an intermediate representation and only then will be dumped onto the disk. Deserialization is the same: the data (binary or text) is read and converted into an intermediate representation (IR). End users can use this IR to save or load their structures of pretty much any complexity.
- Visitor
Flags - Flags that can be used to influence the behavior of Visit::visit methods.
- Visitor
Node - A node is a collection of Fields that exists within a tree of nodes that allows a Visitor to store its data. Each node has a name, and may have a parent node and child nodes. A node is used when visiting complex data, that cannot be represented by a simple memory block.
Enums§
- Format
- Format of the data that be used by a
Visitorinstance for reading or writing from/to an external storage. - Visitor
Version - Version of the visitor.
Constants§
- CURRENT_
VERSION - Current version number of the visitor.
Traits§
Type Aliases§
- Visit
Result - The result of a Visit::visit or of a Visitor encoding operation such as Visitor::save_binary_to_file. It has no value unless an error occurred.
Derive Macros§
- Visit
- Implements
Visittrait