|
51 | 51 | - ##### `#[serde(tag = "type")]` {#tag} |
52 | 52 |
|
53 | 53 | On an enum: Use the internally tagged enum representation, with the given tag. |
54 | | - See [enum representations](enum-representations.md) for details on this |
55 | | - representation. |
| 54 | + See [enum representations] for details on this representation. |
56 | 55 |
|
57 | 56 | On a struct with named fields: Serialize the struct's name (or value of |
58 | 57 | `serde(rename)`) as a field with the given key, in front of all the real |
59 | 58 | fields of the struct. |
60 | 59 |
|
| 60 | + [enum representations]: enum-representations.md |
| 61 | + |
61 | 62 | - ##### `#[serde(tag = "t", content = "c")]` {#tag--content} |
62 | 63 |
|
63 | 64 | Use the adjacently tagged enum representation for this enum, with the given |
64 | | - field names for the tag and content. See [enum |
65 | | - representations](enum-representations.md) for details on this representation. |
| 65 | + field names for the tag and content. See [enum representations] for details on |
| 66 | + this representation. |
66 | 67 |
|
67 | 68 | - ##### `#[serde(untagged)]` {#untagged} |
68 | 69 |
|
69 | | - Use the untagged enum representation for this enum. See [enum |
70 | | - representations](enum-representations.md) for details on this representation. |
| 70 | + Use the untagged enum representation for this enum. See [enum representations] |
| 71 | + for details on this representation. |
71 | 72 |
|
72 | 73 | - ##### `#[serde(variant_identifier)]` {#variant_identifier} |
73 | 74 |
|
|
78 | 79 |
|
79 | 80 | - ##### `#[serde(field_identifier)]` {#field_identifier} |
80 | 81 |
|
81 | | - Identical to [`variant_identifier`](#variant_identifier), but also allows for |
82 | | - the last variant to be a newtype variant, which will be used if none of the |
83 | | - other variants match (similar to [`#[serde(other)]`](variant-attrs.md#other)). |
84 | | - Like `variant_identifier`, this forces the enum to always be represented as a |
85 | | - string, regardless of the underlying data format's representation of enums. |
| 82 | + Identical to [`variant_identifier`], but also allows for the last variant to |
| 83 | + be a newtype variant, which will be used if none of the other variants match |
| 84 | + (similar to [`#[serde(other)]`]). Like `variant_identifier`, this forces the |
| 85 | + enum to always be represented as a string, regardless of the underlying data |
| 86 | + format's representation of enums. |
| 87 | + |
| 88 | + [`variant_identifier`]: #variant_identifier |
| 89 | + [`#[serde(other)`]: variant-attrs.md#other |
86 | 90 |
|
87 | 91 | - ##### `#[serde(bound = "T: MyTrait")]` {#bound} |
88 | 92 |
|
|
110 | 114 |
|
111 | 115 | - ##### `#[serde(remote = "...")]` {#remote} |
112 | 116 |
|
113 | | - This is used for deriving `Serialize` and `Deserialize` for [remote |
114 | | - types](remote-derive.md). |
| 117 | + This is used for deriving `Serialize` and `Deserialize` for [remote types]. |
| 118 | + |
| 119 | + [remote types]: remote-derive.md |
115 | 120 |
|
116 | 121 | - ##### `#[serde(transparent)]` {#transparent} |
117 | 122 |
|
|
0 commit comments