config-lib

Crates.ioconfig-lib
lib.rsconfig-lib
version0.4.0
created_at2025-09-21 15:16:39.565695+00
updated_at2025-09-21 15:16:39.565695+00
descriptionA configuration parsing library supporting CONF, NOML, TOML, and JSON formats.
homepagehttps://github.com/jamesgober/config-lib
repositoryhttps://github.com/jamesgober/config-lib
max_upload_size
id1848882
size210,267
James Gober (jamesgober)

documentation

https://docs.rs/config-lib

README

Triple Hexagon
config-lib

Crates.io Crates.io Downloads docs.rs GitHub CI MSRV

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 config_lib::{Config, EnterpriseConfig};

// Standard configuration management
let mut config = Config::from_file("app.conf")?;
let port = config.get("server.port").unwrap().as_integer()?;
let host = config.get("server.host").unwrap().as_string()?;

// Enterprise configuration with caching
let enterprise = EnterpriseConfig::from_file("production.conf")?;
let cached_value = enterprise.get_or_default("database.timeout", 30)?;

// Modify and track changes
config.set("server.port", 9000)?;
if config.is_modified() {
    config.save()?;
}

๐Ÿ—๏ธ Architecture

Core Components

  • Config - High-level configuration management with change tracking
  • EnterpriseConfig - Performance-optimized caching layer for production systems
  • Value - Type-safe value system with zero-copy string access
  • Error - 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
[dependencies]
config-lib = { version = "0.4.0", features = ["json", "async"] }

โš–๏ธ License

Licensed under the Apache License, version 2.0 (the "License"); you may not use this software, including, but not limited to the source code, media files, ideas, techniques, or any other associated property or concept belonging to, associated with, or otherwise packaged with this software except in compliance with the License.

You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the LICENSE file included with this project for the specific language governing permissions and limitations under the License.

COPYRIGHT © 2025 JAMES GOBER.
Commit count: 15

cargo fmt