libconfig/lib.rs
1//! Serde serialization and deserialization for libconfig format
2//!
3//! This crate provides support for serializing and deserializing Rust data structures
4//! to and from the libconfig configuration file format.
5//!
6//! # Example
7//!
8//! ```
9//! use serde::{Deserialize, Serialize};
10//! use libconfig::{from_str, to_string};
11//!
12//! #[derive(Debug, Serialize, Deserialize, PartialEq)]
13//! struct Config {
14//! name: String,
15//! version: i32,
16//! enabled: bool,
17//! }
18//!
19//! let config = Config {
20//! name: "My App".to_string(),
21//! version: 1,
22//! enabled: true,
23//! };
24//!
25//! let serialized = to_string(&config).unwrap();
26//! let deserialized: Config = from_str(&serialized).unwrap();
27//! assert_eq!(config, deserialized);
28//! ```
29//!
30//! # Further Reading
31//!
32//! - [`config_api`] — full reference for the [`Config`] document wrapper
33//! - [`value_api`] — full reference for the dynamic [`Value`] type
34
35pub mod de;
36pub mod error;
37pub mod ser;
38pub mod value;
39
40pub use de::{Deserializer, from_str};
41pub use error::{Error, Result};
42pub use ser::{Serializer, to_string};
43pub use value::{Config, Map, Value, from_value};
44
45#[doc = include_str!("../CONFIG_API.md")]
46pub mod config_api {}
47
48#[doc = include_str!("../VALUE_API.md")]
49pub mod value_api {}