Crate derived[−][src]
Expand description
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 constructorsGtor
: To generate gettersStor
: To generate settersConstdef
: To generate constant, compile-time default implementations- Full lifetimes, generics and
where
clause support - Use the
gtor
attribute 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
const
with the#[ctor_const]
and#[gtor_const]
attributes - Skip ctors, gtors and stors for
PhantomData
fields with the#[phantom]
attribute