tryphon 0.2.0

Type-safe configuration loading from environment variables using derive macros
Documentation
  • Coverage
  • 86.96%
    40 out of 46 items documented20 out of 22 items with examples
  • Size
  • Source code size: 109.43 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 5.04 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 21s Average build duration of successful builds.
  • all releases: 21s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • katlasik/tryphon
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • katlasik

Tryphon

A type-safe Rust library for loading configuration from environment variables using derive macros.

Crates.io Documentation

Installation

[dependencies]
tryphon = "0.2.0"

Quick Example

use tryphon::{Config, Secret};

#[derive(Debug, Config)]
struct AppConfig {
    #[env("DATABASE_URL")]
    database_url: String,

    #[env("API_KEY")]
    api_key: Secret<String>,

    #[env("PORT")]
    #[default(8080)]
    port: u16,
}

match AppConfig::load() {
    Ok(config) => {
        println!("Server starting on port {}", config.port);
    }
    Err(e) => {
        eprintln!("Configuration error: {}", e);
    }
}

Documentation

📚 Full Documentation on docs.rs

For detailed usage examples, supported types, and API reference, see the full documentation.

License

MIT License