pub struct Options {
pub root_path: String,
pub env: Option<String>,
pub read_envs: bool,
pub env_separator: Option<String>,
}
Expand description
Configuration loader options
Fields§
§root_path: String
Root config folder (defaults to ‘config’)
env: Option<String>
If not set, use APP_ENV environment value or defaults to ‘dev’
read_envs: bool
Loads env variables (defaults to true)
env_separator: Option<String>
Environment var separator
Implementations§
Source§impl Options
Options for loading configuration files
impl Options
Options for loading configuration files
Sourcepub fn new() -> Self
pub fn new() -> Self
Prepare default options
use icee_config_rs::Options;
let opt = Options::new();
Sourcepub fn with_root_path(root_path: &str) -> Self
pub fn with_root_path(root_path: &str) -> Self
Default options with different root path
use icee_config_rs::Options;
let opt = Options::with_root_path("conf");
Sourcepub fn with_app_env(env: &str) -> Self
pub fn with_app_env(env: &str) -> Self
Default options with different env settings
use icee_config_rs::Options;
let opt = Options::with_app_env("test");
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more