difftreelog
Documentation extended
in: master
1 file changed
crates/struct-versioning/src/lib.rsdiffbeforeafterboth28//! pub variable_data: BoundedVec<u8, CustomDataLimit>,28//! pub variable_data: BoundedVec<u8, CustomDataLimit>,29//! }29//! }30//! ...30//! ...31//! `#[version(..2)]` that means that any version before 2 will be upgraded to 2 via the `upper` function31//! `#[version(..2)]` that means that any version before 2 will be upgraded to 2 via the `upper` function.32//! When version become 3 `#[struct_versioning::versioned(version = 3, upper)]` this field will be removed.32//! *upper* - generate From impls, which converts old version of structs to new33//! *upper* - generate From impls, which converts old version of structs to new33//! In this case, the upgrade is described in `on_runtime_upgrade` using the `translate_values` substrate feature34//! In this case, the upgrade is described in `on_runtime_upgrade` using the `translate_values` substrate feature34//!35//!43//! 044//! 044//! }45//! }45//! }46//! }4647//!48//! Another functionality49///50/// `#[versioned(version = 1[, first_version = 1][, upper][, versions])]`51/// - *first_version* - allows to skip generation of structs, which predates first supported version52/// - *versions* - generate enum, which contains all possible versions of struct47use proc_macro::TokenStream;53use proc_macro::TokenStream;48use quote::format_ident;54use quote::format_ident;49use syn::{55use syn::{