derived: A macro to automate the boring stuff
The derived crate aims to provide macros to automate boring things like writing functions
for constructors. Just look at the list of available macros and you'll find an example for each.
Features
- [
Ctor]: To generate constructors - [
Gtor]: To generate getters - [
Stor]: To generate setters - [
Constdef]: To generate constant, compile-time default implementations - Full lifetimes, generics and
whereclause support - Use the
gtorattribute to get either immutable or mutable or both references (see example below) - Skip generation of setters or getters with the
#[stor_skip]or#[gtor_skip]attributes for specific fields - Make ctors and gtors
constwith the#[ctor_const]and#[gtor_const]attributes - Skip ctors, gtors and stors for
PhantomDatafields with the#[phantom]attribute