Crate versionize
source ·Expand description
Defines a generic interface for version tolerant serialization and
implements it for primitive data types using bincode
as backend.
The interface has two components:
Versionize
traitVersionMap
helper
VersionMap
maps individual structure/enum versions to a root version
(app version). This mapping is required both when serializing or
deserializing structures as it needs to know which version of structure
to serialize for a given target app version.
Versionize
trait is implemented for the following primitives:
u8, u16, u32, u64, usize, i8, i16, i32, i64, isize, char, f32, f64,
String, Vec
Known issues and limitations:
- Union serialization is not supported via the
Versionize
proc macro. - Implementing
Versionize
for non-repr(C) unions can result in undefined behaviour and MUST be avoided. - Versionize trait implementations for repr(C) unions must be backed by extensive testing.
- Semantic serialization and deserialization is available only for structures.
Re-exports
pub use version_map::VersionMap;
Modules
- Implements readers and writers that compute the CRC64 checksum of the bytes read/written.
- Serialization support for primitive data types.
- A helper to map struct and enum versions to a sequence of root versions. This helper is required to support the versioning of a hierarchy of structures composed of individually versioned structures or enums.
Enums
- Versioned serialization/deserialization error definitions.
Traits
- Trait that provides an interface for version aware serialization and deserialization. The Versionize proc macro can generate an implementation for a given type if generics are not used, otherwise a manual implementation is required.
Type Aliases
- Versioned serialization/deserialization result.