pub struct Command { /* private fields */ }
Implementations§
Source§impl Command
impl Command
pub fn new<S: AsRef<OsStr>>(program: S) -> PreCommand
pub fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Self
pub fn args<I, S>(&mut self, args: I) -> &mut Self
pub fn env<K, V>(&mut self, key: K, val: V) -> &mut Self
pub fn envs<I, K, V>(&mut self, vars: I) -> &mut Self
pub fn env_remove<K: AsRef<OsStr>>(&mut self, key: K) -> &mut Self
pub fn env_clear(&mut self) -> &mut Command
pub fn current_dir<P: AsRef<Path>>(&mut self, dir: P) -> &mut Command
pub fn stdin<T: Into<Stdio>>(&mut self, cfg: T) -> &mut Command
pub fn stdout<T: Into<Stdio>>(&mut self, cfg: T) -> &mut Command
pub fn stderr<T: Into<Stdio>>(&mut self, cfg: T) -> &mut Command
pub fn spawn(&mut self) -> Result<Child, Error>
Sourcepub fn output(&mut self) -> Result<Output, Error>
pub fn output(&mut self) -> Result<Output, Error>
Blah
use std::io::{self, Write};
let output = sshish::Command::new("ls")
.host("localhost")
.output()
.unwrap();
println!("status: {}", output.status);
assert!(!output.stdout.is_empty());
assert!(output.stderr.is_empty());
io::stdout().write_all(&output.stdout).unwrap();
io::stderr().write_all(&output.stderr).unwrap();
assert!(output.status.success());
pub fn status(&mut self) -> Result<ExitStatus, Error>
Auto Trait Implementations§
impl Freeze for Command
impl !RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl !UnwindSafe for Command
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