pub struct SlenvLoader { /* private fields */ }Expand description
Lazy environment loader that resolves $KEY / ${KEY} references.
Files are loaded on first access, not at construction. Resolution order:
.slenvvalues (highest priority).envvalues- Encrypted
.envviadotenvx get(if dotenvx is on PATH) - Process environment (fallback)
When a resolved value looks like a secret, a warning is emitted to stderr.
Implementations§
Source§impl SlenvLoader
impl SlenvLoader
Sourcepub fn new(dir: &Path) -> Self
pub fn new(dir: &Path) -> Self
Create a loader that will lazily load from dir/.env and dir/.slenv.
Sourcepub fn from_content(content: &str) -> Self
pub fn from_content(content: &str) -> Self
Create a loader from an in-memory string. For testing.
Auto Trait Implementations§
impl !Freeze for SlenvLoader
impl !RefUnwindSafe for SlenvLoader
impl Send for SlenvLoader
impl !Sync for SlenvLoader
impl Unpin for SlenvLoader
impl UnsafeUnpin for SlenvLoader
impl UnwindSafe for SlenvLoader
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