env_sync/
mod.rs

1//! Environment file synchronization library.
2//!
3//! This library provides functionality to parse `.env` files while preserving comments
4//! and synchronize them with template files. It's designed for scenarios where you
5//! want to maintain a template structure while preserving local customizations.
6//!
7//! # Features
8//!
9//! - **Zero-copy parsing**: Uses `Cow<str>` for efficient string handling
10//! - **Comment preservation**: Maintains both preceding and inline comments
11//! - **Flexible synchronization**: Merges template structure with local values
12//! - **Optional tracing**: Detailed logging when the `tracing` feature is enabled
13//!
14//! # Example
15//!
16//! ```rust
17//! use env_sync::sync::{EnvSync, EnvSyncOptions};
18//! use std::path::PathBuf;
19//!
20//! let options = EnvSyncOptions {
21//!     local_file: None, // defaults to .env
22//!     template_file: PathBuf::from(".env.template"),
23//! };
24//!
25//! EnvSync::sync_with_options(options).unwrap();
26//! ```
27
28pub mod parse;
29pub mod sync;