servlet 1.0.0

A small application runtime with an explicit operational contract
Documentation
//! Explicit application settings, captured once into an immutable startup snapshot.
//!
//! Use ordinary Rust structs and `FromStr` types. No environment mutation, dotenv
//! discovery, background tasks, global registry, or hot reload occurs. See
//! `docs/application-settings.md` for precedence and blocking secret-file I/O.

mod builder;
mod capture;
mod error;
mod file;
mod secret;
mod snapshot;

pub use builder::Settings;
pub use error::{SettingsError, SettingsErrorKind};
pub use secret::Secret;
pub use snapshot::Snapshot;

const MAX_KEYS: usize = 128;
const MAX_VALUE: usize = 64 * 1024;
const MAX_TOTAL: usize = 1024 * 1024;

fn valid_key(key: &str) -> bool {
    !key.is_empty()
        && key.len() <= 96
        && key.as_bytes()[0].is_ascii_uppercase()
        && key
            .bytes()
            .all(|c| c.is_ascii_uppercase() || c.is_ascii_digit() || c == b'_')
}