vld-app 0.9.0

Application-edge integrations for the vld validation library: config files (config-rs, figment), environment variables and .env files, clap arguments, Tauri IPC
Documentation

Crates.io Downloads docs.rs Guide License Donate

vld-app

Validate what an application reads at its edges (config files, environment variables, CLI arguments, Tauri IPC) with vld schemas.

[dependencies]
vld = "0.8"
vld-app = { version = "0.8", features = ["config-rs"] }
config = "0.15"
vld::schema! {
    #[derive(Debug)]
    pub struct Settings {
        pub port: i64 => vld::number().int().min(1).max(65535),
        pub host: String => vld::string().min(1),
    }
}

let cfg = config::Config::builder()
    .add_source(config::File::with_name("config.toml"))
    .build()?;
let settings: Settings = vld_app::config::from_config(&cfg)?; // every bad key reported
Module Feature Library
config config-rs and / or figment config-rs 0.14 – 0.15, figment 0.10
env env and / or dotenv environment variables (std), .env files (dotenvy 0.15)
clap clap (turns on vld/derive) clap 4
tauri — Tauri IPC payloads (no tauri dependency)

No feature is on by default; any set can be enabled together.

Support

If vld helps you, you can support it via DonationAlerts. Bugs and ideas: issues.

License

MIT