@ @derive
@derive(I, …)
Applies to: data, enum, distinct
Section: §4.6
Syntax
Attr = "@" Path [ "(" [ AttrArgs ] ")" ] ;Grammar: App. A
Defined in
- 4.6 Interfaces — Interfaces are structural
- 3.6 Aliases, new types and refined types — distinct T creates a new nominal type with the representation of T.
- 3.9 Copy and move — Copy types: primitives, str, bytes, Duration, Time and other time types, distinct/refined types over a Copy type, tuples and arrays of Copy
- 4.3 Construction and constructors — Literal. T{ f1: e1, f2, ..base }
- 4.9 Attributes — Syntax: @name or @name(arguments) before a declaration, field, parameter or rpc.
- 15.4 User-defined attributes and code generation — attr Name { fields } declares an attribute; comptime fn Name.apply(d
Related diagnostics
explicit-interface, interface-not-satisfied, refinement-violated, use-after-move, bad-init, missing-field, must-close, positional-literal, sealed-literal, deprecated