pub struct WorkingDirectory(/* private fields */);Expand description
The directory in which an external command runs
Some commands work on the directory that they run in. A build tool reads the manifest of the project in that directory, and a formatter reads the configuration file that it finds there. Such a command carries the directory that it needs.
A command without a working directory runs where the process runs. Most commands need no directory of their own, which is why an invocation does not require one.
Implementations§
Source§impl WorkingDirectory
impl WorkingDirectory
Sourcepub fn new(path: PathBuf) -> WorkingDirectory
pub fn new(path: PathBuf) -> WorkingDirectory
Creates a new WorkingDirectory
This method creates a new WorkingDirectory from a PathBuf.
§Example
use std::path::PathBuf;
use typed_fields::path;
path!(MyPath);
let path = MyPath::new(PathBuf::from("src"));Trait Implementations§
Source§impl Clone for WorkingDirectory
impl Clone for WorkingDirectory
Source§fn clone(&self) -> WorkingDirectory
fn clone(&self) -> WorkingDirectory
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 moreSource§impl Debug for WorkingDirectory
impl Debug for WorkingDirectory
Source§impl Display for WorkingDirectory
impl Display for WorkingDirectory
impl Eq for WorkingDirectory
Source§impl From<&Path> for WorkingDirectory
impl From<&Path> for WorkingDirectory
Source§fn from(path: &Path) -> WorkingDirectory
fn from(path: &Path) -> WorkingDirectory
Converts to this type from the input type.
Source§impl From<&str> for WorkingDirectory
impl From<&str> for WorkingDirectory
Source§fn from(string: &str) -> WorkingDirectory
fn from(string: &str) -> WorkingDirectory
Converts to this type from the input type.
Source§impl From<PathBuf> for WorkingDirectory
Creates a working directory from a path that the application built at
runtime
impl From<PathBuf> for WorkingDirectory
Creates a working directory from a path that the application built at runtime
Source§fn from(path: PathBuf) -> WorkingDirectory
fn from(path: PathBuf) -> WorkingDirectory
Converts to this type from the input type.
Source§impl From<String> for WorkingDirectory
impl From<String> for WorkingDirectory
Source§fn from(string: String) -> WorkingDirectory
fn from(string: String) -> WorkingDirectory
Converts to this type from the input type.
Source§impl Hash for WorkingDirectory
impl Hash for WorkingDirectory
Source§impl Ord for WorkingDirectory
impl Ord for WorkingDirectory
Source§fn cmp(&self, other: &WorkingDirectory) -> Ordering
fn cmp(&self, other: &WorkingDirectory) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for WorkingDirectory
impl PartialEq for WorkingDirectory
Source§impl PartialOrd for WorkingDirectory
impl PartialOrd for WorkingDirectory
impl StructuralPartialEq for WorkingDirectory
Auto Trait Implementations§
impl Freeze for WorkingDirectory
impl RefUnwindSafe for WorkingDirectory
impl Send for WorkingDirectory
impl Sync for WorkingDirectory
impl Unpin for WorkingDirectory
impl UnsafeUnpin for WorkingDirectory
impl UnwindSafe for WorkingDirectory
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