pub struct EnvironmentConfig {
pub variables: HashMap<String, EnvValue>,
pub env_files: Vec<EnvFileRef>,
pub passthrough_prefixes: Vec<String>,
pub passthrough_vars: Vec<String>,
}Expand description
Environment variable configuration.
Fields§
§variables: HashMap<String, EnvValue>Static environment variables.
env_files: Vec<EnvFileRef>Environment files to load (.env format).
passthrough_prefixes: Vec<String>Environment variable prefixes to pass through from host.
passthrough_vars: Vec<String>Specific host env vars to pass through.
Implementations§
Source§impl EnvironmentConfig
impl EnvironmentConfig
Sourcepub fn with_var(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn with_var(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add a plain text variable.
Sourcepub fn with_reference(
self,
key: impl Into<String>,
ref_var: impl Into<String>,
) -> Self
pub fn with_reference( self, key: impl Into<String>, ref_var: impl Into<String>, ) -> Self
Add a variable reference.
Sourcepub fn with_secret(self, key: impl Into<String>, secret_ref: SecretRef) -> Self
pub fn with_secret(self, key: impl Into<String>, secret_ref: SecretRef) -> Self
Add a secret reference.
Sourcepub fn with_env_file(self, path: impl Into<String>) -> Self
pub fn with_env_file(self, path: impl Into<String>) -> Self
Add an environment file to load.
Sourcepub fn with_optional_env_file(self, path: impl Into<String>) -> Self
pub fn with_optional_env_file(self, path: impl Into<String>) -> Self
Add an optional environment file.
Sourcepub fn with_passthrough_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_passthrough_prefix(self, prefix: impl Into<String>) -> Self
Add a passthrough prefix.
Sourcepub fn with_passthrough_var(self, var: impl Into<String>) -> Self
pub fn with_passthrough_var(self, var: impl Into<String>) -> Self
Add a specific passthrough variable.
Sourcepub fn variable_keys(&self) -> Vec<&str>
pub fn variable_keys(&self) -> Vec<&str>
Get all variable keys.
Sourcepub fn secret_refs(&self) -> Vec<(&str, &SecretRef)>
pub fn secret_refs(&self) -> Vec<(&str, &SecretRef)>
Get all secret references.
Trait Implementations§
Source§impl Clone for EnvironmentConfig
impl Clone for EnvironmentConfig
Source§fn clone(&self) -> EnvironmentConfig
fn clone(&self) -> EnvironmentConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EnvironmentConfig
impl Debug for EnvironmentConfig
Source§impl Default for EnvironmentConfig
impl Default for EnvironmentConfig
Source§fn default() -> EnvironmentConfig
fn default() -> EnvironmentConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for EnvironmentConfig
impl<'de> Deserialize<'de> for EnvironmentConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for EnvironmentConfig
impl RefUnwindSafe for EnvironmentConfig
impl Send for EnvironmentConfig
impl Sync for EnvironmentConfig
impl Unpin for EnvironmentConfig
impl UnwindSafe for EnvironmentConfig
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