Skip to main content

config

Attribute Macro config 

Source
#[config]
Expand description

Defines a configuration struct for the application. This macro generates the necessary code to deserialize the struct from the configuration toml file.

The struct must derive Deserialize from serde.

§Parameters

  • key: The key in the configuration file where the struct is located.

§Usage

#[derive(Deserialize)]
#[config(key = "my-section")]
struct MyConfig {
    my_key: String,
}