pub struct VirtualWorkingDirEnv { /* private fields */ }Expand description
An environment module for keeping track of the current working directory.
This is a “virtual” implementation because changing the working directory through this environment will not affect the working directory of the entire process.
Implementations§
Source§impl VirtualWorkingDirEnv
impl VirtualWorkingDirEnv
Sourcepub fn new<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn new<P: AsRef<Path>>(path: P) -> Result<Self>
Constructs a new environment with a provided working directory.
The specified path must be an absolute path or an error will result.
Sourcepub fn with_path_buf(path: PathBuf) -> Result<Self>
pub fn with_path_buf(path: PathBuf) -> Result<Self>
Constructs a new environment with a provided PathBuf as a working directory.
The specified path must be an absolute path or an error will result.
Sourcepub fn with_process_working_dir() -> Result<Self>
pub fn with_process_working_dir() -> Result<Self>
Constructs a new environment and initializes it with the current working directory of the current process.
Trait Implementations§
Source§impl Clone for VirtualWorkingDirEnv
impl Clone for VirtualWorkingDirEnv
Source§fn clone(&self) -> VirtualWorkingDirEnv
fn clone(&self) -> VirtualWorkingDirEnv
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VirtualWorkingDirEnv
impl Debug for VirtualWorkingDirEnv
Source§impl PartialEq for VirtualWorkingDirEnv
impl PartialEq for VirtualWorkingDirEnv
impl Eq for VirtualWorkingDirEnv
impl StructuralPartialEq for VirtualWorkingDirEnv
Auto Trait Implementations§
impl Freeze for VirtualWorkingDirEnv
impl RefUnwindSafe for VirtualWorkingDirEnv
impl Send for VirtualWorkingDirEnv
impl Sync for VirtualWorkingDirEnv
impl Unpin for VirtualWorkingDirEnv
impl UnwindSafe for VirtualWorkingDirEnv
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