pub struct EnvLayer { /* private fields */ }Expand description
Settings read from environment variables.
Implementations§
Source§impl EnvLayer
impl EnvLayer
Sourcepub fn from_process() -> Self
pub fn from_process() -> Self
The variables this process was started with.
std::env::vars panics on a name or value that is not UTF-8, which would take the CLI down
before it resolved anything — over a variable that in all likelihood belongs to something
else entirely. Read as OS strings and skipped when they will not convert: a setting whose
variable holds bytes this cannot read has no value it could have been given anyway.
Sourcepub fn new(vars: impl IntoIterator<Item = (String, String)>) -> Self
pub fn new(vars: impl IntoIterator<Item = (String, String)>) -> Self
A named environment, for a test or for a CLI that has its own idea of one.
Trait Implementations§
Source§impl Layer for EnvLayer
impl Layer for EnvLayer
Source§fn source(&self) -> SourceKind
fn source(&self) -> SourceKind
Which kind of place this reads. Used by the scope check and reported by
explain.Source§fn load(&self, ctx: &LayerCtx) -> Result<LayerOutput, LayerError>
fn load(&self, ctx: &LayerCtx) -> Result<LayerOutput, LayerError>
Everything this layer has to say, in one pass.
Auto Trait Implementations§
impl Freeze for EnvLayer
impl RefUnwindSafe for EnvLayer
impl Send for EnvLayer
impl Sync for EnvLayer
impl Unpin for EnvLayer
impl UnsafeUnpin for EnvLayer
impl UnwindSafe for EnvLayer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more