1 unstable release
0.1.0 | Nov 28, 2021 |
---|
#36 in #getter-setter
9KB
59 lines
Gusket
Gusket is a getter/setter derive macro.
lib.rs
:
Gusket
Gusket is a getter/setter derive macro.
Comparison with getset
:
gusket
only exposes one derive macro. No need toderive(Getters, MutGetters, Setters)
all the time. This avoids accidentally forgetting some derives, e.g. writing#[getset(get_copy)]
with only#[derive(getset::Getters)]
will generate nothing without triggering a compile error.gusket
uses the struct visibility by default. This means that the usual boilerplate#[getset(get = "pub", get_mut = "pub", set = "pub")]
is simplified to just#[gusket]
.gusket
generates code from the span of the field (not the derive call), so error messages are more readable.
Dependencies
~1.5MB
~36K SLoC