@@ -22,15 +22,21 @@ mod consts;
22
22
/// ## Declaring Versions
23
23
///
24
24
/// It is **important** to note that this macro must be placed before any other
25
- /// (derive) macros and attributes. This ensures that the macros and attributes
26
- /// are applied to the generated versioned instances of the struct or enum.
25
+ /// (derive) macros and attributes. Macros supplied before the versioned macro
26
+ /// will be erased, because the original struct or enum (container) is erased,
27
+ /// and new containers are generated. This ensures that the macros and
28
+ /// attributes are applied to the generated versioned instances of the
29
+ /// container.
27
30
///
28
31
/// Before any of the fields or variants can be versioned, versions need to be
29
32
/// declared at the container level. Each version currently supports two
30
33
/// parameters: `name` and the `deprecated` flag. The `name` must be a valid
31
- /// (and supported) format - currently, only Kubernetes API versions are
32
- /// supported. The macro checks each declared version and reports any error
33
- /// encountered during parsing.
34
+ /// (and supported) format.
35
+ ///
36
+ /// <div class="warning">
37
+ /// Currently, only Kubernetes API versions are supported. The macro checks each
38
+ /// declared version and reports any error encountered during parsing.
39
+ /// </div>
34
40
///
35
41
/// ```
36
42
/// # use stackable_versioned_macros::versioned;
@@ -46,9 +52,9 @@ mod consts;
46
52
/// 1. The `#[automatically_derived]` attribute indicates that the following
47
53
/// piece of code is automatically generated by a macro instead of being
48
54
/// handwritten by a developer. This information is used by cargo and rustc.
49
- /// 2. For each declared version, a new module containing the struct or enum
50
- /// (container) is generated. This enables you to reference the container by
51
- /// versions via `v1alpha1::Foo`.
55
+ /// 2. For each declared version, a new module containing the container is
56
+ /// generated. This enables you to reference the container by versions via
57
+ /// `v1alpha1::Foo`.
52
58
/// 3. This `use` statement gives the generated containers access to the imports
53
59
/// at the top of the file. This is a convenience, because otherwise you
54
60
/// would need to prefix used items with `super::`. Additionally, other
@@ -117,8 +123,8 @@ mod consts;
117
123
///
118
124
/// ## Item Actions
119
125
///
120
- /// This library currently supports three different item actions. Items can
121
- /// be added, renamed and deprecated. The macro ensures that these actions
126
+ /// This crate currently supports three different item actions. Items can
127
+ /// be added, changed, and deprecated. The macro ensures that these actions
122
128
/// adhere to the following set of rules:
123
129
///
124
130
/// 1. Items cannot be added and deprecated in the same version.
@@ -366,15 +372,15 @@ mod consts;
366
372
/// automatically generates `From` implementations. On a high level, code
367
373
/// generated for two versions _a_ and _b_, with _a < b_ looks like this:
368
374
/// `impl From<a> for b`. As you can see, only upgrading is currently supported.
369
- /// Downgrading, so going from a higher version to a lower one, is not supported
370
- /// at the moment.
375
+ /// Downgrading from a higher version to a lower one is not supported at the
376
+ /// moment.
371
377
///
372
378
/// This automatic generation can be skipped to for example enable a custom
373
379
/// implementation for more complex conversions.
374
380
///
375
381
/// ### Skipping at the Container Level
376
382
///
377
- /// Disabling this feature on the container level results in no `From`
383
+ /// Disabling this behavior at the container level results in no `From`
378
384
/// implementation for all versions.
379
385
///
380
386
/// ```
@@ -397,7 +403,7 @@ mod consts;
397
403
///
398
404
/// ### Skipping at the Version Level
399
405
///
400
- /// Disabling this feature at the version level results in no `From`
406
+ /// Disabling this behavior at the version level results in no `From`
401
407
/// implementation for that particular version. This can be read as "skip
402
408
/// generation for converting _this_ version to the next one". In the example
403
409
/// below no conversion between version `v1beta1` and `v1` is generated.
0 commit comments