You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@ Please make sure to add your changes to the appropriate categories:
26
26
27
27
- Bumped MSRV from "1.74.0" to "1.78.0".
28
28
- Made the enum-level `#[enumcapsulate(exclude(…))]` helper macros only have an effect on derives, when orchestrated through the `Encapsulate` derive macro.
29
+
- Made `Encapsulate` derive macro no longer derive `VariantDiscriminant`.
|`Encapsulate`| Derives impls for `AsVariant`, `AsVariantMut`, `AsVariantRef`, `From`, `FromVariant`, `IntoVariant`, `TryInto`, and `VariantDowncast`.|
19
+
|`FromVariant`| Derives impls for `Self: enumcapsulate::FromVariant<T>` for each non-unit variant type `T`.|
20
+
|`IntoVariant`| Derives impls for `Self: enumcapsulate::FromVariant<T>` for each non-unit variant type `T`.|
21
+
|`From`| Derives impls for `Self: core::convert::From<T>` for each non-unit variant type `T`.|
22
+
|`TryInto`| Derives impls for `T: core::convert::TryFrom<Self>` for each non-unit variant type `T`.|
23
+
|`AsVariant`| Derives impls for `Self: enumcapsulate::AsVariant<T>` for each non-unit variant type `T`.|
24
+
|`AsVariantMut`| Derives impls for `Self: enumcapsulate::AsVariantMut<T>` for each non-unit variant type `T`.|
25
+
|`AsVariantRef`| Derives impls for `Self: enumcapsulate::AsVariantRef<T>` for each non-unit variant type `T`. |
26
+
|`VariantDowncast`| Derives impl for `Self: enumcapsulate::VariantDowncast`. |
27
+
|`VariantDiscriminant`| Derives impl for `Self: enumcapsulate::VariantDiscriminant`. |
28
28
29
29
> [!NOTE]
30
30
> The implementations generated by the `From` and `FromVariant`, as well as the `TryInto` and `IntoVariant` derive macro pairs are semantically equivalent.
31
31
32
32
### `#[derive(Encapsulate)]`
33
33
34
-
The umbrella derive macro `Encapsulate` allows for conveniently deriving `AsVariant`, `AsVariantMut`, `AsVariantRef`, `From`, `FromVariant`, `IntoVariant`, `TryInto`, `VariantDiscriminant`, and `VariantDowncast` all at once.
34
+
The umbrella derive macro `Encapsulate` allows for conveniently deriving `AsVariant`, `AsVariantMut`, `AsVariantRef`, `From`, `FromVariant`, `IntoVariant`, `TryInto`, and `VariantDowncast` all at once.
35
35
36
36
The following two snippets are semantically equivalent:
37
37
@@ -42,14 +42,14 @@ enum Enum { /* ... */ }
42
42
43
43
```rust
44
44
#[derive(
45
-
FromVariant,
46
-
IntoVariant,
47
45
From,
48
46
TryInto,
47
+
FromVariant,
48
+
IntoVariant,
49
49
AsVariant,
50
50
AsVariantMut,
51
51
AsVariantRef,
52
-
VariantDiscriminant,
52
+
VariantDowncast,
53
53
)]
54
54
enumEnum { /* ... */ }
55
55
```
@@ -96,7 +96,7 @@ Exclude this variant from trait derivation.
0 commit comments