Skip to main content

ConfigOption

Trait ConfigOption 

Source
pub trait ConfigOption {
    // Required methods
    fn env_var(&self) -> Option<&'static str>;
    fn cli_flag(&self) -> Option<&'static str>;
    fn cli_short(&self) -> Option<char>;
    fn config_path(&self) -> &'static str;
    fn help_text(&self) -> &'static str;
}
Expand description

Trait for configuration options that can be set via CLI, env vars, or config file

Required Methods§

Source

fn env_var(&self) -> Option<&'static str>

Get the environment variable name for this option

Source

fn cli_flag(&self) -> Option<&'static str>

Get the long CLI flag for this option

Source

fn cli_short(&self) -> Option<char>

Get the short CLI flag for this option

Source

fn config_path(&self) -> &'static str

Get the config file path for this option (e.g., “server.host”)

Source

fn help_text(&self) -> &'static str

Get the help text for this option

Implementors§