wrath 0.1.0

A structured approach to accessing environment variables
Documentation
#![doc = include_str!("../README.md")]

/// Automatically implement the [`TryFrom`] and [`TryFromEnv`] traits
#[doc = include_str!("try_from_env.md")]
pub use wrath_macros::TryFromEnv;

pub mod error;
pub mod parser;

/// Attempt to parse the environment variables into structured data
///
/// The easiest/recommended way to implement this trait is via the derive macro,
/// [`TryFromEnv`](wrath_macros::TryFromEnv).
pub trait TryFromEnv
where
    Self: Sized,
{
    /// An error that can occur during parsing
    type Error;

    /// Attempt to parse the environment variables into structured data
    ///
    /// # Errors
    ///
    /// This function can fail if parsing fails or a required value is unset for
    /// all relevant environment variables. As many errors as possible will be
    /// returned at once, which helps to reduce the amount of time users spend
    /// restarting your program while trying to get it set up.
    fn try_from_env() -> Result<Self, Vec<Self::Error>>;
}