Skip to main content

Module visitor

Module visitor 

Source
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 Blackboard docs 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§

BinaryBlob
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 serialize Vec<u8> serialize each byte as a separate node which is very inefficient.
RegionGuard
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.
VisitorFlags
Flags that can be used to influence the behavior of Visit::visit methods.
VisitorNode
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 Visitor instance for reading or writing from/to an external storage.
VisitorVersion
Version of the visitor.

Constants§

CURRENT_VERSION
Current version number of the visitor.

Traits§

Visit
Trait of types that can be read from a Visitor or written to a Visitor.

Type Aliases§

VisitResult
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 Visit trait