File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
crates/stackable-versioned-macros/src Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -645,6 +645,41 @@ mod utils;
645645/// ```
646646/// </details>
647647///
648+ /// ## Additional Arguments
649+ ///
650+ /// In addition to the field actions, the following top-level field arguments
651+ /// are available:
652+ ///
653+ /// ### Hinting Wrapper Types
654+ ///
655+ /// With `#[versioned(hint(...))]` it is possible to give hints to the macro
656+ /// that the field contains a wrapped type. Currently, these following hints
657+ /// are supported:
658+ ///
659+ /// - `hint(option)`: Indicates that the field contains an `Option<T>`.
660+ /// - `hint(vec)`: Indicates that the field contains a `Vec<T>`.
661+ ///
662+ /// These hints are especially useful for generated conversion functions. With
663+ /// these hints in place, the types are correctly mapped using `Into::into`.
664+ ///
665+ /// ```
666+ /// # use stackable_versioned_macros::versioned;
667+ /// #[versioned(
668+ /// version(name = "v1alpha1"),
669+ /// version(name = "v1beta1")
670+ /// )]
671+ /// mod versioned {
672+ /// pub struct Foo {
673+ /// #[versioned(
674+ /// changed(since = "v1beta1", from_type = "Vec<usize>"),
675+ /// hint(vec)
676+ /// )]
677+ /// bar: Vec<usize>,
678+ /// baz: bool,
679+ /// }
680+ /// }
681+ /// ```
682+ ///
648683/// # Generated Helpers
649684///
650685/// This macro generates a few different helpers to enable different operations
You can’t perform that action at this time.
0 commit comments