pub struct Env { /* private fields */ }Implementations§
Source§impl Env
impl Env
Sourcepub fn load(path: &Path) -> Result<Self>
pub fn load(path: &Path) -> Result<Self>
Read .run/.env. A missing file is not an error: the defaults baked
into docker-compose.yml still apply.
pub fn get(&self, key: &str) -> Option<&str>
pub fn get_or<'a>(&'a self, key: &str, fallback: &'a str) -> &'a str
pub fn set(&mut self, key: &str, value: impl Into<String>)
pub fn is_true(&self, key: &str, fallback: bool) -> bool
Sourcepub fn truthy(value: &str) -> bool
pub fn truthy(value: &str) -> bool
The same spelling of yes the shell accepts, for a value read from anywhere — a file, or a running container’s environment.
pub fn iter(&self) -> impl Iterator<Item = (&String, &String)>
Sourcepub fn derive(&mut self, root: &Path)
pub fn derive(&mut self, root: &Path)
The values the shell’s load_env computes after sourcing the file.
root is the workspace directory: the settings hold paths relative to
it, and compose resolves a relative path against its own project
directory, which is somewhere else entirely — so they are made absolute
here or the bind mounts point at nothing.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Env
impl RefUnwindSafe for Env
impl Send for Env
impl Sync for Env
impl Unpin for Env
impl UnsafeUnpin for Env
impl UnwindSafe for Env
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