stdlib/configView source ↗
config
20 items · generated by scribe fromstdlib/config.fd· synced 2026-11-15
Contents
- CONFIG_STR: (const)
- Config (struct)
- config_new (function)
- config_opt (function)
- config_req (function)
- config_load (function)
- config_str (function)
- config_int (function)
- config_bool (function)
- config_float (function)
- config_given (function)
CONFIG_STR:
pub const CONFIG_STR: i64 = 0; pub const CONFIG_INT: i64 = 1; pub const CONFIG_BOOL: i64 = 2; pub const CONFIG_FLOAT: i64 = 3;Defined at line 21
Config
pub struct Config {Fields:
| Name | Type |
|---|---|
fields | Vec<ConfigField> |
Defined at line 33
config_new
pub fn config_new() -> Config {Returns: Config
Defined at line 37
config_opt
Declare a key with a default value.
pub fn config_opt(c: & mut Config, name: str, kind: i64, def: str) {Parameters:
c:& mut Configname:strkind:i64def:str
Defined at line 44
config_req
Declare a key that file, env or flags must supply.
pub fn config_req(c: & mut Config, name: str, kind: i64) {Parameters:
c:& mut Configname:strkind:i64
Defined at line 51
config_load
Load every declared key: —name flag, then PREFIXNAME env, then the file’s key, then the declared default. A required key no source supplies panics naming it; a value of the wrong kind panics naming it too.
pub fn config_load(c: & mut Config, file_path: str, env_prefix: str) {Parameters:
c:& mut Configfile_path:strenv_prefix:str
Defined at line 154
config_str
pub fn config_str(c: Config, name: str) -> str {Parameters:
c:Configname:str
Returns: str
Defined at line 214
config_int
pub fn config_int(c: Config, name: str) -> i64 {Parameters:
c:Configname:str
Returns: i64
Defined at line 218
config_bool
pub fn config_bool(c: Config, name: str) -> bool {Parameters:
c:Configname:str
Returns: bool
Defined at line 222
config_float
pub fn config_float(c: Config, name: str) -> f64 {Parameters:
c:Configname:str
Returns: f64
Defined at line 227
config_given
Was name supplied by a flag, env or the file (not just its default)?
pub fn config_given(c: Config, name: str) -> bool {Parameters:
c:Configname:str
Returns: bool
Defined at line 232
Generated by scribe, the Fides documentation generator