Settings

Settings are the individual fields of a Config struct or variants of a Config enum, and can be annotated with the optional #[setting] attribute.

Attribute fields

The following fields are supported for the #[setting] field/variant attribute:

And the following for serde compatibility:

  • alias
  • flatten
  • rename
  • skip
  • skip_deserializing
  • skip_serializing

Serde support

A handful of serde attribute fields are currently supported (above) and will apply a #[serde] attribute to the partial implementation.

#![allow(unused)]
fn main() {
#[derive(Config)]
struct Example {
	#[setting(rename = "type")]
	pub type_of: SomeEnum,
}
}

These values can also be applied using #[serde], which is useful if you want to apply them to the main struct as well, and not just the partial struct.