std.deriving
std.deriving provides a method for automatically generating interface implementations based on fields and attributes of classes, structs, and enumerated types.
Currently, implementations of the following interfaces can be automatically generated:
For more examples, see Deriving User Manual.
API List
Macros
| Name | Description |
|---|---|
| Derive | Modifies declarations such as structs, classes, or enums as a core macro, and automatically extends interfaces for modified declarations. For details, see Automatically Extending Interfaces. |
| DeriveExclude | Excludes fields that do not need to be processed from declarations modified by @derive. For details, see Excluding Fields Not to Be Processed. By default, fields are processed by deriving. |
| DeriveInclude | Adds properties that need to be processed to declarations modified by @derive. For details, see Adding Properties to Be Processed. By default, properties are not processed by deriving. |
| DeriveOrder | Specifies the order of processing fields and properties for declarations modified by @derive. For details, see Specifying the Order of Processing Fields and Properties. Generally, this macro is meaningful for the Comparable interface. |