These proc macros help you to implement the envir::Serialize and
envir::Deserialize traits.
Attributes
By default, these macro use the uppercase field name as environment variable name.
use Deserialize;
let config = from_env;
dbg!;
)
Container
prefix: sets this attributes to add this prefix at the field name.
use Deserialize;
let config = from_env;
dbg!;
)
Field
name: use this name for the environment variable instead of the name of the field. Ifprefixis defined, it also prepend to this name;export_with: use this function to export this field. The given function must be callable asfn (T) -> HashMap<String, String>;load_with: use this function to load this field. The given function must be callable asfn (Hashmap<String, String>) -> envir::Result<T>;noprefix: doesn’t add theprefixfor this field;nested: this field should be de/serialized recursively.
use Deserialize;
let config = from_env;
dbg!;
)