pub struct Environment {
pub cwd: PathBuf,
pub home: PathBuf,
pub repo_root: Option<PathBuf>,
}Expand description
Paths the resolver needs from the environment — factored out so tests can inject their own without touching the real filesystem.
Fields§
§cwd: PathBuf§home: PathBufUser’s home directory (typically dirs::home_dir()).
repo_root: Option<PathBuf>Root of the current repository, if any.
Implementations§
Source§impl Environment
impl Environment
Sourcepub fn detect() -> Result<Self>
pub fn detect() -> Result<Self>
Build an Environment from the real operating system.
The DEVBOY_HOME_OVERRIDE environment variable, when set,
replaces the detected home directory. This exists mostly for
integration tests that want to redirect installs into a
temporary directory on platforms (notably Windows) where
dirs::home_dir() resolves through the OS rather than through
$HOME / $USERPROFILE.
Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
Source§fn clone(&self) -> Environment
fn clone(&self) -> Environment
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Environment
impl RefUnwindSafe for Environment
impl Send for Environment
impl Sync for Environment
impl Unpin for Environment
impl UnsafeUnpin for Environment
impl UnwindSafe for Environment
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