Crate tfhe_versionable
source ·Expand description
Provides a way to add versioning informations/backward compatibility on rust types used for serialization.
This crates provides a set of traits Versionize and Unversionize that perform a
conversion between a type and its Versioned counterpart. The versioned type is an enum
that has a variant for each version of the type.
These traits can be generated using the tfhe_versionable_derive::Versionize proc macro.
Re-exports§
pub use derived_traits::Version;pub use derived_traits::VersionsDispatch;pub use upgrade::Upgrade;
Modules§
- These traits are not meant to be manually implemented, they are just used in the derive macro for easier access to generated types
- How to perform conversion from one version to the next.
Enums§
- Errors that can arise in the unversionizing process.
Traits§
- Marker trait for a type that it not really versioned, where the
versionizemethod returns Self or &Self. - This trait means that we can convert from a versioned enum into the target type.
- This trait means that the type can be converted into a versioned equivalent type.
- This trait is used as a proxy to be more felxible when deriving Versionize for Vec
.
Derive Macros§
- This derives the
VersionizeandUnversionizetrait for a type that should not be versioned. Theversionizemethod will simply return self - Implement the
Versiontrait for the target type. - This derives the
VersionizeandUnversionizetrait for the target type. - Implement the
VersionsDispatchtrait for the target type. The type where this macro is applied should be an enum where each variant is a version of the type that we want to versionize.