1#![doc = include_str!("../rustdoc.md")]
2#![deny(clippy::as_conversions)]
3#![deny(clippy::enum_glob_use)]
4#![deny(clippy::wildcard_imports)]
5#![deny(missing_docs)]
6#![deny(unsafe_code)]
7#![deny(rustdoc::bare_urls)]
8#![deny(rustdoc::broken_intra_doc_links)]
9#![deny(rustdoc::invalid_codeblock_attributes)]
10#![deny(rustdoc::invalid_html_tags)]
11#![deny(rustdoc::invalid_rust_codeblocks)]
12#![deny(rustdoc::private_intra_doc_links)]
13#![warn(clippy::if_then_some_else_none)]
14#![warn(clippy::pedantic)]
15#![allow(clippy::doc_markdown)] #![allow(clippy::module_name_repetitions)] #![allow(clippy::must_use_candidate)] #![allow(clippy::semicolon_if_nothing_returned)] #![allow(clippy::let_underscore_untyped)] #![allow(clippy::missing_errors_doc)] #![cfg_attr(doc_unstable, feature(doc_auto_cfg))]
22
23mod error;
24mod fallback;
25mod file;
26mod glob;
27mod linereader;
28mod parser;
29mod properties;
30pub mod property;
31pub mod rawvalue;
32mod section;
33#[cfg(test)]
34mod tests;
35mod traits;
36pub mod version;
37
38pub use error::{Error, ParseError};
39pub use file::{ConfigFile, ConfigFiles};
40pub use parser::ConfigParser;
41pub use properties::{Properties, PropertiesSource};
42pub use section::Section;
43pub use traits::*;
44
45#[cfg(feature = "language-tags")]
46pub mod language_tags {
47 pub use ::language_tags::*;
49}
50
51pub fn properties_of(path: impl AsRef<std::path::Path>) -> Result<Properties, Error> {
61 properties_from_config_of(path, Option::<&std::path::Path>::None)
62}
63
64pub fn properties_from_config_of(
75 target_path: impl AsRef<std::path::Path>,
76 config_path_override: Option<impl AsRef<std::path::Path>>,
77) -> Result<Properties, Error> {
78 let mut retval = Properties::new();
79 ConfigFiles::open(&target_path, config_path_override)?.apply_to(&mut retval, &target_path)?;
80 Ok(retval)
81}