[][src]Struct reef::Command

pub struct Command { /* fields omitted */ }

Metadata about a std::process::Command

Implementations

impl Command[src]

pub fn which(name: &str) -> Option<PathBuf>[src]

uses the PATH environment variable to search for a filename matching the specified name. if a matching filename is not found, it will check for the existence of name.exe and name.bat

Example

use reef::Command;
let git_path = Command::which("git").unwrap();
assert!(git_path.exists());

pub fn shebang(path: &Path) -> Result<String, Box<dyn Error>>[src]

extracts the text following the shebang #!

Example

given a file with the contents:

#!C:/Ruby26-x64/bin/ruby.exe

the shebang method will return C:/Ruby26-x64/bin/ruby.exe

use reef::Command;
use std::env;
let path = std::env::temp_dir().join("test.rb");
std::fs::write(&path,b"#!C:/Ruby26-x64/bin/ruby.exe")?;
let target = Command::shebang(&path).unwrap();
assert_eq!("C:/Ruby26-x64/bin/ruby.exe",target);

pub fn new(command: &str, path: &Path) -> Command[src]

pub fn exec(&self) -> Result<Command, Box<dyn Error>>[src]

execute a command

pub fn dir(&self) -> PathBuf[src]

The working directory

pub fn name(&self) -> &str[src]

The command name

pub fn success(&self) -> bool[src]

pub fn success_symbol(&self) -> String[src]

pub fn exit_code(&self) -> i32[src]

The exit code of the process

pub fn stdout(&self) -> &str[src]

pub fn stderr(&self) -> &str[src]

pub fn duration(&self) -> &Duration[src]

pub fn timeout(&self) -> &Duration[src]

pub fn set_timeout(&self, timeout: Duration) -> Command[src]

pub fn tags(&self) -> &HashSet<String>[src]

pub fn set_tags(&mut self, tags: &HashSet<String>)[src]

pub fn uuid(&self) -> &str[src]

pub fn duration_string(&self) -> String[src]

pub fn summary(&self) -> String[src]

pub fn details(&self) -> Vec<String>[src]

pub fn start_utc(&self) -> DateTime<Utc>[src]

pub fn start_local(&self) -> DateTime<Local>[src]

pub fn env(&self) -> &Env[src]

pub fn to_json(&self) -> Result<String, Box<dyn Error>>[src]

Trait Implementations

impl Clone for Command[src]

impl Debug for Command[src]

impl Default for Command[src]

impl<'de> Deserialize<'de> for Command[src]

impl Display for Command[src]

impl Eq for Command[src]

impl From<Error> for Command[src]

impl Ord for Command[src]

impl PartialEq<Command> for Command[src]

impl PartialOrd<Command> for Command[src]

impl Serialize for Command[src]

impl StructuralEq for Command[src]

impl StructuralPartialEq for Command[src]

Auto Trait Implementations

impl RefUnwindSafe for Command

impl Send for Command

impl Sync for Command

impl Unpin for Command

impl UnwindSafe for Command

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,