6 releases

0.1.1 Jan 19, 2023
0.1.0 Sep 15, 2022
0.0.3 Aug 5, 2022
0.0.2 May 18, 2022
0.0.1 Apr 23, 2022

#394 in Encoding

Download history 2419/week @ 2023-12-11 2395/week @ 2023-12-18 1731/week @ 2023-12-25 1807/week @ 2024-01-01 2023/week @ 2024-01-08 2828/week @ 2024-01-15 2955/week @ 2024-01-22 2564/week @ 2024-01-29 1358/week @ 2024-02-05 394/week @ 2024-02-12 1793/week @ 2024-02-19 2796/week @ 2024-02-26 2310/week @ 2024-03-04 2847/week @ 2024-03-11 4026/week @ 2024-03-18 3473/week @ 2024-03-25

12,710 downloads per month
Used in 5 crates (2 directly)

Apache-2.0

34KB
876 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

~255–560KB
~11K SLoC