pub struct CurrentDir<T: AsRef<Path>>(pub T);Expand description
By default child processes inherit the current directory from their
parent. You can override this with CurrentDir:
use cradle::prelude::*;
let StdoutTrimmed(output) = run_output!("pwd", CurrentDir("/tmp"));
assert_eq!(output, "/tmp");Paths that are relative to the parent’s current directory are allowed.
Tuple Fields§
§0: TTrait Implementations§
Source§impl<T: Clone + AsRef<Path>> Clone for CurrentDir<T>
impl<T: Clone + AsRef<Path>> Clone for CurrentDir<T>
Source§fn clone(&self) -> CurrentDir<T>
fn clone(&self) -> CurrentDir<T>
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 moreAuto Trait Implementations§
impl<T> Freeze for CurrentDir<T>where
T: Freeze,
impl<T> RefUnwindSafe for CurrentDir<T>where
T: RefUnwindSafe,
impl<T> Send for CurrentDir<T>where
T: Send,
impl<T> Sync for CurrentDir<T>where
T: Sync,
impl<T> Unpin for CurrentDir<T>where
T: Unpin,
impl<T> UnwindSafe for CurrentDir<T>where
T: UnwindSafe,
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