configurant 0.8.14

Schema-first configuration: declare values in a TOML schema, layer defaults, file, environment and command line, validate with named errors, explain where each value came from. No generated code; secrets never printed.
Documentation
// SPDX-License-Identifier: MIT OR Apache-2.0
//! ConfigurAnt: schema-first configuration. A project declares its values in `configurant.toml`;
//! this library parses the schema, layers values (default < file < environment < command line),
//! validates them with named errors, and explains where each value came from. It generates no
//! code, and a value marked `secret` is never printed. See `README.md` and `docs/DESIGN.md`.
#![forbid(unsafe_code)]
#![warn(missing_docs)]

pub mod config;
pub mod edit;
pub mod error;
pub mod exec;
pub mod json_schema;
pub mod keycheck;
pub mod migrate;
pub mod module;
pub mod modules;
#[cfg(feature = "persistant")]
pub mod persistant;
pub mod project;
pub mod schema;
pub mod schema_edit;
mod typo;
pub mod value;
pub mod view;
pub mod wizard;

/// The largest schema, fragment or configuration text this library reads. Longer text is refused before it is
/// parsed, so a hostile or mistaken input cannot make the parser spend unbounded time and memory.
pub const MAX_TEXT_BYTES: usize = 1 << 20;

/// Why `text` is refused for its size, if it is. Says sizes only, never any of the text.
pub(crate) fn too_large(text: &str) -> Option<String> {
    (text.len() > MAX_TEXT_BYTES).then(|| {
        format!(
            "the text is {} bytes, larger than the {MAX_TEXT_BYTES} this reads",
            text.len()
        )
    })
}

pub use config::{Config, DEFAULT_ORDER, ExplainLine, Explanation, FromValue, Layer, Loader};
pub use error::{ConfigError, Errors, Origin};
pub use migrate::{MigrateError, Migrated};
pub use module::{
    Action, ActionKind, Choice, ChoiceList, INTERFACE_VERSION, MIN_INTERFACE_VERSION, Module,
    ModuleError, Modules, Needs, Plan,
};
pub use project::{HostFormat, HostSupplied, Projection, Skipped, Var};
pub use schema::{
    Bound, MapDef, Migration, Mount, Op, Project, Schema, SchemaError, Step, TableDef, ValueDef,
    When,
};
pub use value::{Row, Value, ValueType};