Environment Variables Provider
This Rust library provides a feature flag provider that resolves feature flags from environment variables.
Supported Types
The provider supports the following types:
- Int
- Float
- String
- Bool
Please note that Struct type is not currently supported yet.
Error Handling
The provider will return EvaluationResult::Err(EvaluationError) if the flag is not found or if the value is not of the expected type.
Usage
Add this to your Cargo.toml:
[]
= "0.1.0"
Example
let mut api = singleton_mut.await;
let provider = default;
api.set_provider.await;
let client = api.create_named_client;
let mut message = "Hello rustaceans!";
let is_feature_enabled = client.get_bool_value.await.unwrap_or;
if is_feature_enabled
Testing
Run cargo test to execute tests.
Maintainers
License
Apache 2.0 - See LICENSE for more information.