wopt-0.2.7 has been yanked.
wopt (with-options)
Description
A procedural macro that automatically generates an Option-wrapped version of a struct, reducing boilerplate for optional updates.
Example
use *;
Field Attributes
| Name | Description |
|---|---|
required |
Does not wrap the specified field with an Option. |
skip |
Does not include the specified field. |
Optional Features
| Name | Description |
|---|---|
| rkyv | Serialize/Deserialize using rkyv. |
| serde | Seriailze/Deserialize using serde. |
Additional Notes
The automatically generated optional-struct does not come with any trait/derivation implementations. The fields are publicized, however, it may be helpful to specify the Default trait:
// attempts to implement `Default`
;