1 unstable release

0.1.0 Nov 28, 2021

#39 in #getter-setter

Apache-2.0

9KB
59 lines

Gusket

GitHub actions crates.io crates.io docs.rs GitHub GitHub

Gusket is a getter/setter derive macro.


lib.rs:

Gusket

GitHub actions crates.io crates.io docs.rs GitHub GitHub

Gusket is a getter/setter derive macro.

Comparison with getset:

  • gusket only exposes one derive macro. No need to derive(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
~37K SLoC