Skip to main content

Config

Trait Config 

Source
pub trait Config<Key: Into<String>>: Send + Sync {
    // Required methods
    fn get(&self, name: Key) -> Result<String, OperationOutcomeError>;
    fn set(&self, name: Key, value: String) -> Result<(), OperationOutcomeError>;
}

Required Methods§

Source

fn get(&self, name: Key) -> Result<String, OperationOutcomeError>

Gets the value of an environment configuration variable.

§Errors

Returns [OperationOutcomeError] if the environment variable is not set or cannot be read.

Source

fn set(&self, name: Key, value: String) -> Result<(), OperationOutcomeError>

Sets the value of an environment configuration variable.

§Errors

Returns [OperationOutcomeError] if setting the variable fails.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§