From b182cae136259b5c2abeafc802e44f7c3e04c95f Mon Sep 17 00:00:00 2001 From: Techassi Date: Mon, 22 Dec 2025 11:52:10 +0100 Subject: [PATCH 1/2] docs(stackable-versioned): Add section about hint(...) --- crates/stackable-versioned-macros/src/lib.rs | 35 ++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/crates/stackable-versioned-macros/src/lib.rs b/crates/stackable-versioned-macros/src/lib.rs index 40124d688..4f4d5e6ab 100644 --- a/crates/stackable-versioned-macros/src/lib.rs +++ b/crates/stackable-versioned-macros/src/lib.rs @@ -645,6 +645,41 @@ mod utils; /// ``` /// /// +/// ## Additional Arguments +/// +/// In addition to the field actions, the following top-level field arguments +/// are available: +/// +/// ### Hinting Wrapper Types +/// +/// With `#[versioned(hint(...))]` it is possible to give hints to the macro +/// that the field contains a wrapped type. Currently, these following hints +/// are supported: +/// +/// - `hint(option)`: Indicates that the field contains an `Option`. +/// - `hint(vec)`: Indicates that the field contains a `Vec`. +/// +/// These hints are especially useful for generated conversion functions. With +/// these hints in place, the types are correctly mapped using `Into::into`. +/// +/// ``` +/// # use stackable_versioned_macros::versioned; +/// #[versioned( +/// version(name = "v1alpha1"), +/// version(name = "v1beta1") +/// )] +/// mod versioned { +/// pub struct Foo { +/// #[versioned( +/// changed(since = "v1beta1", from_type = "Vec"), +/// hint(vec) +/// )] +/// bar: Vec, +/// baz: bool, +/// } +/// } +/// ``` +/// /// # Generated Helpers /// /// This macro generates a few different helpers to enable different operations From efc60efc2600e7d4f7f799806944d748579c3cd0 Mon Sep 17 00:00:00 2001 From: Techassi Date: Mon, 5 Jan 2026 08:58:40 +0100 Subject: [PATCH 2/2] docs(versioned): Adjust #[versioned(hint)] wording Co-authored-by: Andrew Kenworthy --- crates/stackable-versioned-macros/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/stackable-versioned-macros/src/lib.rs b/crates/stackable-versioned-macros/src/lib.rs index 4f4d5e6ab..56e32277b 100644 --- a/crates/stackable-versioned-macros/src/lib.rs +++ b/crates/stackable-versioned-macros/src/lib.rs @@ -660,7 +660,9 @@ mod utils; /// - `hint(vec)`: Indicates that the field contains a `Vec`. /// /// These hints are especially useful for generated conversion functions. With -/// these hints in place, the types are correctly mapped using `Into::into`. +/// these hints in place, the types are correctly mapped using `Into::into` +/// (assuming the necessary `From` trait methods are implemented on the target +/// types for the conversion to be done correctly). /// /// ``` /// # use stackable_versioned_macros::versioned;