1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//! # serde-envfile
//! Built ontop the [`dotenvy`](https://github.com/allan2/dotenvy) and
//! [`envy`](https://github.com/softprops/envy) crates, `serde-envfile`
//! supports both the serialization and the deserialization of environment
//! variables from or to files (`from_file`, `to_file`), strings
//! (`from_str`, `to_string`), or the environment of the application
//! (`from_env`).
//!
//! ## Examples
//! Note that keys are transformed to lowercase during deserialization.
//! With serialization, the contrary is the case.
//! ```no_run
//! use serde::{Deserialize, Serialize};
//! use serde_envfile::{Error, from_str, to_string};
//!
//! #[derive(Debug, Deserialize, Serialize)]
//! struct Test {
//! hello: String,
//! }
//!
//! fn main() -> Result<(), Error> {
//! let env = "HELLO=\"WORLD\"";
//! let test: Test = from_str(env)?;
//! let env = to_string(&test)?;
//!
//! println!("{}", env);
//!
//! Ok(())
//! }
//! ```
//!
//! Introducing the `Value` type, `serde-envfile`, also provides a more flexible approach to working with environment variables.
//! ```no_run
//! use serde_envfile::{to_string, Error, Value};
//!
//! fn main() -> Result<(), Error> {
//! let mut env = Value::new();
//! env.insert("hello".into(), "world".into());
//! let env = to_string(&env)?;
//!
//! println!("{}", env);
//!
//! Ok(())
//! }
//! ```
pub
pub
pub
pub
pub use ;
pub use Error;
pub use ;
pub use ;
pub use Value;