Config-lib is a high-performance, enterprise-grade configuration management library for Rust applications requiring extreme performance and reliability. Built for database technologies and high-concurrency systems demanding sub-50ns access times.
๐ Performance First
- โก 25ns cached access times (2x faster than enterprise targets)
- ๐ฅ 1M+ concurrent operations with linear scaling
- โ๏ธ Zero-copy optimizations throughout the entire stack
- ๐ก๏ธ Thread-safe caching with
Arc<RwLock>
for enterprise environments
Built for database technology that's "3 times faster, 1,000 times stronger, and 90% more efficient than Oracle."
๐ฆ Multi-Format Support
Built-in CONF parser with optional support for:
- ๐ง CONF - Native high-performance format (default)
- ๐ JSON - Standard JSON configuration files
- ๐ NOML - Next-generation configuration language
- ๐ TOML - Tom's Obvious Minimal Language
โจ Core Features
- ๐ฏ Type-Safe Access - Zero-panic value retrieval with comprehensive error handling
- ๐ Change Tracking - Automatic modification detection and state management
- ๐ Dot Notation - Intuitive nested access (
config.get("server.database.host")
) - ๐งต Thread Safety - Full concurrency support for high-load environments
- ๐ Configuration Merging - Intelligent overlay and inheritance systems
- ๐ Enterprise Caching - Multi-instance management with sub-nanosecond overhead
- ๐ Cross Platform - Supports Linux, macOS, and Windows
- ๐ฌ Comment Preservation - Maintains formatting and documentation in config files
๐ ๏ธ Quick Start
use ;
// Standard configuration management
let mut config = from_file?;
let port = config.get.unwrap.as_integer?;
let host = config.get.unwrap.as_string?;
// Enterprise configuration with caching
let enterprise = from_file?;
let cached_value = enterprise.get_or_default?;
// Modify and track changes
config.set?;
if config.is_modified
๐๏ธ Architecture
Core Components
Config
- High-level configuration management with change trackingEnterpriseConfig
- Performance-optimized caching layer for production systemsValue
- Type-safe value system with zero-copy string accessError
- Comprehensive error handling with source location context
Enterprise Performance
- Cached Access: 25ns average (validated with Criterion benchmarks)
- Concurrent Scaling: Linear performance up to 32+ threads
- Memory Efficiency: Zero-copy string operations, intelligent caching
- Production Ready: Designed for 1M+ concurrent operations
๐๏ธ Feature Flags
Feature | Default | Description |
---|---|---|
conf |
โ | CONF format parsing (built-in) |
json |
โ | JSON format support |
noml |
โ | NOML format support |
toml |
โ | TOML format support |
async |
โ | Async file operations |
chrono |
โ | DateTime support |
schema |
โ | Schema validation |
# Cargo.toml
[]
= { = "0.4.0", = ["json", "async"] }