git.delta.rocks / unique-network / refs/commits / ec76b9ccb1e6

difftreelog

Documentation extended

Dev2022-07-13parent: #573a067.patch.diff
in: master

1 file changed

modifiedcrates/struct-versioning/src/lib.rsdiffbeforeafterboth
28//! 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 new
33//! 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 feature
34//!35//!
43//! 044//! 0
44//! }45//! }
45//! }46//! }
4647//!
48//! Another functionality
49///
50/// `#[versioned(version = 1[, first_version = 1][, upper][, versions])]`
51/// - *first_version* - allows to skip generation of structs, which predates first supported version
52/// - *versions* - generate enum, which contains all possible versions of struct
47use proc_macro::TokenStream;53use proc_macro::TokenStream;
48use quote::format_ident;54use quote::format_ident;
49use syn::{55use syn::{