pub struct AutoMapEnvArgs<'a> {
pub divider: &'a str,
pub prefix: Option<&'a str>,
pub transform: Box<dyn Fn(&str) -> String>,
}
Expand description
Automatically map environment variables into config.
Fields§
§divider: &'a str
The divider that separates different levels of the parent.child relationship for the
mapping. This will get replaced with .
when converting the name of a variable to a TomlKeyPath
. The default value is DEFAULT_DOTENV_PATH
.
prefix: Option<&'a str>
Prefix for environment variables to be mapped. By default this will be DEFAULT_CONFIG_VARIABLE_NAME
.
transform: Box<dyn Fn(&str) -> String>
A transform operation to perform on the environment variable before parsing it. By default this transforms it to lowercase.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for AutoMapEnvArgs<'a>
impl<'a> !RefUnwindSafe for AutoMapEnvArgs<'a>
impl<'a> !Send for AutoMapEnvArgs<'a>
impl<'a> !Sync for AutoMapEnvArgs<'a>
impl<'a> Unpin for AutoMapEnvArgs<'a>
impl<'a> !UnwindSafe for AutoMapEnvArgs<'a>
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