pub struct DtactCommand(/* private fields */);Expand description
Async-friendly wrapper over std::process::Command. Builder methods
mirror std::process::Command’s own naming.
Implementations§
Source§impl DtactCommand
impl DtactCommand
Sourcepub fn env(
&mut self,
key: impl AsRef<OsStr>,
val: impl AsRef<OsStr>,
) -> &mut Self
pub fn env( &mut self, key: impl AsRef<OsStr>, val: impl AsRef<OsStr>, ) -> &mut Self
Set an environment variable for the child process.
Sourcepub fn current_dir(&mut self, dir: impl AsRef<Path>) -> &mut Self
pub fn current_dir(&mut self, dir: impl AsRef<Path>) -> &mut Self
Set the working directory the child process is spawned in.
Sourcepub fn stdin(&mut self, cfg: Stdio) -> &mut Self
pub fn stdin(&mut self, cfg: Stdio) -> &mut Self
Configure how the child’s stdin is set up (inherit/pipe/null).
Sourcepub fn stdout(&mut self, cfg: Stdio) -> &mut Self
pub fn stdout(&mut self, cfg: Stdio) -> &mut Self
Configure how the child’s stdout is set up (inherit/pipe/null).
Sourcepub fn stderr(&mut self, cfg: Stdio) -> &mut Self
pub fn stderr(&mut self, cfg: Stdio) -> &mut Self
Configure how the child’s stderr is set up (inherit/pipe/null).
Sourcepub fn spawn(&mut self) -> Result<DtactChild>
pub fn spawn(&mut self) -> Result<DtactChild>
Spawn the child process. A direct synchronous syscall — see the module doc for why this isn’t dispatched to the pool.
§Errors
Returns whatever std::process::Command::spawn returns: most
commonly io::ErrorKind::NotFound if program isn’t on PATH/
doesn’t exist, or PermissionDenied if it exists but isn’t
executable by the current user.
Auto Trait Implementations§
impl !RefUnwindSafe for DtactCommand
impl !UnwindSafe for DtactCommand
impl Freeze for DtactCommand
impl Send for DtactCommand
impl Sync for DtactCommand
impl Unpin for DtactCommand
impl UnsafeUnpin for DtactCommand
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