bare-config 0.1.0

The type-safe configuration authority for Rust. A pluggable framework for full CRUD operations across multiple backends with 'Parse, don't validate' philosophy.
Documentation
  • Coverage
  • 0%
    0 out of 1 items documented0 out of 0 items with examples
  • Size
  • Source code size: 17.15 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 963.47 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 22s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • franckcl1989

bare-config

The type-safe configuration authority for Rust.

A pluggable framework that evolves beyond static loading to provide full CRUD operations across multiple backends, enforcing "Parse, don't validate" for the entire configuration lifecycle.

Overview

bare-config is not just another configuration loader. It is a Configuration Authority that:

  • Validates at boundaries - Configuration is parsed and validated once at system entry points
  • Enforces type safety - Strongly typed configuration values prevent invalid states
  • Supports full CRUD - Read, create, update, and delete operations across multiple backends
  • Pluggable backends - File system, environment variables, remote services, and custom backends
  • Zero runtime overhead - After validation, configuration access is cost-free

Philosophy

Parse, Don't Validate

Traditional configuration libraries mix parsing and validation throughout the codebase. bare-config separates these concerns:

  1. Parse - Convert raw configuration data (TOML, YAML, JSON, etc.) into typed values
  2. Validate - Ensure values meet constraints at system boundaries
  3. Trust - Use validated values without re-checking within the system

This eliminates primitive obsession and ensures data integrity where it matters most.

Quick Start

use bare_config::{Config, ConfigBuilder};

#[derive(Debug, Clone)]
struct AppConfig {
    host: String,
    port: u16,
    max_connections: usize,
}

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config: AppConfig = ConfigBuilder::new()
        .load_file("config.toml")?
        .load_env()?
        .build()?;

    println!("Server running on {}:{}", config.host, config.port);
    Ok(())
}

Features

  • Type-safe configuration - Strongly typed values with compile-time guarantees
  • Multiple backends - File system, environment variables, and extensible backend system
  • CRUD operations - Full lifecycle management of configuration values
  • Hot reloading - Optional runtime configuration updates
  • Validation - Schema-based validation with detailed error messages
  • Zero dependencies - Core functionality has no external dependencies

Roadmap

  • Core configuration framework
  • File system backends (TOML, YAML, JSON, INI)
  • Environment variable backend
  • Validation schema system
  • CRUD operations
  • Hot reloading
  • Remote configuration backends
  • Configuration migration tools

License

Licensed under either of:

Contributing

Contributions are welcome! Please open an issue or submit a PR.

Related Crates

  • bare-types - Zero-cost foundation for type-safe domain modeling