pub struct ParserConfig {
pub allow_expansion: bool,
pub strict: bool,
pub max_expansion_depth: usize,
pub allow_inline_comments: bool,
pub trim_values: bool,
pub allow_multiline: bool,
}Expand description
Controls parser behaviour. Construct with Default::default() and
override individual fields as needed.
§Example
use dotenv_space::core::parser::ParserConfig;
// Strict mode: only uppercase keys, no inline comments
let config = ParserConfig {
strict: true,
allow_inline_comments: false,
..Default::default()
};Fields§
§allow_expansion: boolEnable ${VAR} and $VAR substitution in values.
Default: true.
strict: boolEnforce all-uppercase keys. Fails with ParseError::InvalidKey if a
lowercase key is encountered.
Default: false.
max_expansion_depth: usizeMaximum number of recursive expansions before raising
ParseError::ExpansionDepthExceeded. Prevents runaway expansion of
deeply nested variable references.
Default: 10.
allow_inline_comments: boolStrip inline comments from unquoted values. When true, the # and
everything after it on unquoted lines is discarded.
Example: PORT=8080 # web server → PORT=8080.
Default: true.
trim_values: boolTrim leading and trailing whitespace from values after all other processing. Quoted values are never trimmed — their whitespace is always preserved.
Default: true.
allow_multiline: boolAccept values that span multiple lines. A value whose opening quote is not closed on the same line accumulates subsequent lines until the closing quote is found.
Default: true.
Trait Implementations§
Source§impl Clone for ParserConfig
impl Clone for ParserConfig
Source§fn clone(&self) -> ParserConfig
fn clone(&self) -> ParserConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more