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§
- deprecation
- Handle the deprecation of older versions of some types
- derived_
traits - These traits are not meant to be manually implemented, they are just used in the derive macro for easier access to generated types
- upgrade
- How to perform conversion from one version to the next.
Enums§
- Unversionize
Error - Errors that can arise in the unversionizing process.
Traits§
- NotVersioned
- Marker trait for a type that it not really versioned, where the
versionize
method returns Self or &Self. - Unversionize
- This trait means that we can convert from a versioned enum into the target type.
- Unversionize
Vec - Versionize
- This trait means that the type can be converted into a versioned equivalent type.
- Versionize
Owned - Versionize
Slice - This trait is used as a proxy to be more flexible when deriving Versionize for
Vec<T>
. - Versionize
Vec
Derive Macros§
- NotVersioned
- This derives the
Versionize
andUnversionize
trait for a type that should not be versioned. Theversionize
method will simply return self - Version
- Implement the
Version
trait for the target type. - Versionize
- This derives the
Versionize
andUnversionize
trait for the target type. - Versions
Dispatch - Implement the
VersionsDispatch
trait 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.