[−][src]Trait yasec::Yasec
Indicates that structure can be initialize from environment variables.
Provided methods
fn init() -> Result<Self, Error> where
Self: Sized,
Self: Sized,
Creates empty context and calls with_context
.
fn with_prefix(prefix: impl AsRef<str>) -> Result<Self, Error> where
Self: Sized,
Self: Sized,
fn with_context(context: Context<Self>) -> Result<Self, Error> where
Self: Sized,
Self: Sized,
Initialize structure from environment variable from the passed context.
By default calls parse
method. It works for a basic type like number or string.
The method is redefined for a sctructure with #[derive(Yasec)
. In that case
the method pick every field type and calls the method for the type.
fn parse(_val: &str) -> Result<Self, Box<dyn StdError>> where
Self: Sized,
Self: Sized,
Parses an environment variable value. It sould be implemented if an object is leaf of a configuration structure.