pub struct Parser {
pub prefix: Option<String>,
pub separator: String,
pub include: Vec<Regex>,
pub exclude: Vec<Regex>,
pub json: Value,
}
Expand description
Parse environment variables into json
Fields§
§prefix: Option<String>
The prefix to use when parsing environment variables
separator: String
The separator to use when parsing environment variables
include: Vec<Regex>
Available on crate feature
filter
only.List of regex patterns to include. One of the patterns must match for the variable to be included
exclude: Vec<Regex>
Available on crate feature
filter
only.List of regex patterns to exclude. All of the patterns must not match for the variable to be included
json: Value
The json object to merge the parsed environment variables into
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn with_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_prefix(self, prefix: impl Into<String>) -> Self
Return a new parser with the given prefix
Sourcepub fn with_separator(self, separator: impl Into<String>) -> Self
pub fn with_separator(self, separator: impl Into<String>) -> Self
Return a new parser with the given separator
Sourcepub fn with_include(self, include: &[&str]) -> Self
Available on crate feature filter
only.
pub fn with_include(self, include: &[&str]) -> Self
filter
only.Return a new parser with the given include patterns
Requires the filter
feature
Sourcepub fn with_exclude(self, exclude: &[&str]) -> Self
Available on crate feature filter
only.
pub fn with_exclude(self, exclude: &[&str]) -> Self
filter
only.Return a new parser with the given exclude patterns
Sourcepub fn parse_from_env(&self) -> Result<Value, Error>
pub fn parse_from_env(&self) -> Result<Value, Error>
Parse environment variables into json
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
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