7 releases

0.2.0 Aug 5, 2024
0.1.1 Jan 19, 2023
0.1.0 Sep 15, 2022
0.0.3 Aug 5, 2022
0.0.1 Apr 23, 2022

#225 in Parser implementations

Download history 7094/week @ 2024-07-21 6129/week @ 2024-07-28 8365/week @ 2024-08-04 8411/week @ 2024-08-11 6247/week @ 2024-08-18 4044/week @ 2024-08-25 5224/week @ 2024-09-01 11289/week @ 2024-09-08 9980/week @ 2024-09-15 9265/week @ 2024-09-22 10233/week @ 2024-09-29 12652/week @ 2024-10-06 11838/week @ 2024-10-13 12774/week @ 2024-10-20 12309/week @ 2024-10-27 8520/week @ 2024-11-03

45,963 downloads per month
Used in 8 crates (4 directly)

Apache-2.0

36KB
888 lines

serde-env   Build Status Latest Version

Deserialize env into structs via serde

Quick Start

use serde::Deserialize;
use serde_env::from_env;

#[derive(Debug, Deserialize)]
struct Cargo {
    home: String,
}

#[derive(Debug, Deserialize)]
struct Test {
    home: String,
    cargo: Cargo,
}

fn main() {
    let t: Test = from_env().expect("deserialize from env");

    assert!(!t.home.is_empty());
    assert!(!t.cargo.home.is_empty());
    println!("{:?}", t)
}

Contributing

Check out the CONTRIBUTING.md guide for more details on getting started with contributing to this project.

Getting help

Submit issues for bug report or asking questions in discussion.

Acknowledgment

This project is highly inspired by envy

License

Licensed under Apache License, Version 2.0.

Dependencies

~205–470KB