pub struct EnvironmentFile { /* private fields */ }Expand description
One ordered environment-file declaration.
This value describes source intent only. Importing it never reads the referenced file. A caller that wants to materialize environment values must cross a separate filesystem-access boundary and apply the source implementation’s parsing rules explicitly.
Implementations§
Source§impl EnvironmentFile
impl EnvironmentFile
Sourcepub fn new(
path: ProtectedString,
syntax: EnvironmentFileSyntax,
) -> Result<Self, ModelError>
pub fn new( path: ProtectedString, syntax: EnvironmentFileSyntax, ) -> Result<Self, ModelError>
Creates an environment-file declaration with a non-empty path.
§Errors
Returns ModelError::EmptyValue or ModelError::ContainsNul.
Sourcepub const fn path(&self) -> &ProtectedString
pub const fn path(&self) -> &ProtectedString
Returns the source-authored path without resolving or reading it.
Sourcepub const fn syntax(&self) -> EnvironmentFileSyntax
pub const fn syntax(&self) -> EnvironmentFileSyntax
Returns the authored short/long syntax family.
Sourcepub fn set_required(&mut self, required: Sourced<bool>)
pub fn set_required(&mut self, required: Sourced<bool>)
Retains an explicit required/optional choice.
Sourcepub const fn required(&self) -> Option<&Sourced<bool>>
pub const fn required(&self) -> Option<&Sourced<bool>>
Returns the explicit required/optional choice, if authored.
Sourcepub fn is_required(&self) -> bool
pub fn is_required(&self) -> bool
Returns whether the source requires the file, including the default of true.
Sourcepub fn set_format(&mut self, format: Sourced<EnvironmentFileFormat>)
pub fn set_format(&mut self, format: Sourced<EnvironmentFileFormat>)
Retains an explicitly selected parsing mode.
Sourcepub const fn format(&self) -> Option<&Sourced<EnvironmentFileFormat>>
pub const fn format(&self) -> Option<&Sourced<EnvironmentFileFormat>>
Returns the explicitly selected parsing mode, if authored.
Trait Implementations§
Source§impl Clone for EnvironmentFile
impl Clone for EnvironmentFile
Source§fn clone(&self) -> EnvironmentFile
fn clone(&self) -> EnvironmentFile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more