pub trait IntoExecutablePath {
    // Required method
    fn to_executable(self) -> OsString;
}
Expand description

An implementation detail of cmd, to distinguish paths from other string types.

Path("foo.sh") means the file named foo.sh in the current directory. However if you try to execute that path with std::process::Command, Unix will get upset that it doesn’t have a leading ./. Rust knows that the string is a path, but that distinction gets lost by the time execution happens.

To execute relative paths correctly, duct prepends the ./ to them automatically. This trait captures the distinction between the path types and other types of strings, which don’t get modified. See the trait bounds on cmd.

Required Methods§

Implementations on Foreign Types§

source§

impl IntoExecutablePath for String

source§

impl IntoExecutablePath for OsString

source§

impl IntoExecutablePath for PathBuf

source§

impl<'a> IntoExecutablePath for &'a str

source§

impl<'a> IntoExecutablePath for &'a String

source§

impl<'a> IntoExecutablePath for &'a OsStr

source§

impl<'a> IntoExecutablePath for &'a OsString

source§

impl<'a> IntoExecutablePath for &'a Path

source§

impl<'a> IntoExecutablePath for &'a PathBuf

Implementors§