bare-config 0.2.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

bare-config

Type-safe configuration CRUD with a unified API across JSON, YAML, TOML, and Properties.

Design Goal

  • Parse once at boundaries.
  • Operate on typed values (Value) through a consistent interface (ConfigContent).
  • Avoid introducing a separate runtime validation framework in core.

Features

  • Unified ConfigContent trait for select/insert/update/delete/upsert
  • Unified key path model (Key, KeySegment)
  • Unified value model (Value)
  • Format modules behind feature gates: json, yaml, toml, properties

Quick Start

use bare_config::json::JsonContent;
use bare_config::{ConfigContent, Key, Value};
use std::str::FromStr;

let mut cfg = JsonContent::from_str(r#"{"server":{"port":8080}}"#)?;
let port = cfg.select(&Key::from_str(".server.port")?)?;
assert_eq!(port.as_integer(), Some(8080));

cfg.upsert(&Key::from_str(".server.host")?, &Value::string("127.0.0.1"))?;
println!("{}", cfg);
# Ok::<(), Box<dyn std::error::Error>>(())

License

Licensed under either: