gix_config/lib.rs
1//! # `gix_config`
2//!
3//! This crate is a high performance `git-config` file reader and writer. It
4//! exposes a high level API to parse, read, and write [`git-config` files].
5//!
6//! This crate has a few primary offerings and various accessory functions. The
7//! table below gives a brief explanation of all offerings, loosely in order
8//! from the highest to lowest abstraction.
9//!
10//! | Offering | Description | Zero-copy? |
11//! | ------------- | --------------------------------------------------- | ----------------- |
12//! | [`File`] | Accelerated wrapper for reading and writing values. | On some reads[^1] |
13//! | [`parse::State`] | Syntactic events for `git-config` files. | Yes |
14//! | value wrappers | Wrappers for `git-config` value types. | Yes |
15//!
16//! This crate also exposes efficient value normalization which unescapes
17//! characters and removes quotes through the `normalize_*` family of functions,
18//! located in the [`value`] module.
19//!
20//! # Known differences to the `git config` specification
21//!
22//! - Legacy headers like `[section.subsection]` are supposed to be turned into to lower case and compared
23//! case-sensitively. We keep its case and compare case-insensitively.
24//!
25//! [^1]: When read values do not need normalization and it wasn't parsed in 'owned' mode.
26//!
27//! [`git-config` files]: https://git-scm.com/docs/git-config#_configuration_file
28//! [`File`]: crate::File
29//! [`parse::State`]: crate::parse::Events
30//! [`nom`]: https://github.com/Geal/nom
31//!
32//! ## Feature Flags
33#![cfg_attr(
34 all(doc, feature = "document-features"),
35 doc = ::document_features::document_features!()
36)]
37#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))]
38#![deny(missing_docs, rust_2018_idioms, unsafe_code)]
39
40pub mod file;
41
42///
43pub mod lookup;
44pub mod parse;
45///
46pub mod value;
47pub use gix_config_value::{color, integer, path, Boolean, Color, Integer, Path};
48
49mod key;
50pub use key::{AsKey, KeyRef};
51mod types;
52pub use types::{File, Source};
53///
54pub mod source;