CommandExt

Trait CommandExt 

Source
pub trait CommandExt {
    // Required methods
    fn arg_for_macos<S: AsRef<OsStr>>(&mut self, arg: S) -> Result<&mut Command>;
    fn configure_prefix<P: AsRef<Path>>(
        &mut self,
        path: P,
    ) -> Result<&mut Command>;
    fn with_pkgconfig(&mut self) -> Result<&mut Command>;
    fn with_toolchain(&mut self) -> Result<&mut Command>;
}
Expand description

Decorator for the std::process::Command adding a some chainable helpers.

Mostly useful for calling ./configure scripts.

Required Methods§

Source

fn arg_for_macos<S: AsRef<OsStr>>(&mut self, arg: S) -> Result<&mut Command>

Add this argument to the commands, but only on macos.

Source

fn configure_prefix<P: AsRef<Path>>(&mut self, path: P) -> Result<&mut Command>

Add a --prefix to point to a toolchain sysroot or the /, depending on dinghy environment.

Source

fn with_pkgconfig(&mut self) -> Result<&mut Command>

Adds pkgconfig environment variables to point to an eventual cross compiling sysroot.

Usefull for compatibilty with pkg-config-rs up to 0.3.9 or to deal with ./configure scripts.

Source

fn with_toolchain(&mut self) -> Result<&mut Command>

Propagate TARGET, TARGET_CC, TARGET_AR and TARGET_SYSROOT to a ./configure script.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl CommandExt for Command

Source§

fn arg_for_macos<S: AsRef<OsStr>>(&mut self, arg: S) -> Result<&mut Command>

Source§

fn configure_prefix<P: AsRef<Path>>( &mut self, prefix_dir: P, ) -> Result<&mut Command>

Source§

fn with_pkgconfig(&mut self) -> Result<&mut Command>

Source§

fn with_toolchain(&mut self) -> Result<&mut Command>

Implementors§