[−][src]Struct reef::Command
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 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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl From<Error> for Command
[src]
impl Serialize 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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,