pub struct CommandBuilder { /* private fields */ }Expand description
命令构建器(Builder 模式)
Implementations§
Source§impl CommandBuilder
impl CommandBuilder
Sourcepub fn current_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn current_dir(self, dir: impl Into<PathBuf>) -> Self
设置工作目录
Sourcepub fn stdin_piped(self) -> Self
pub fn stdin_piped(self) -> Self
捕获标准输入
Sourcepub async fn spawn(self) -> Result<Child, ProcessError>
pub async fn spawn(self) -> Result<Child, ProcessError>
启动进程
Sourcepub async fn output(self) -> Result<ProcessOutput, ProcessError>
pub async fn output(self) -> Result<ProcessOutput, ProcessError>
执行并等待输出
Trait Implementations§
Source§impl Default for CommandBuilder
impl Default for CommandBuilder
Source§fn default() -> CommandBuilder
fn default() -> CommandBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CommandBuilder
impl RefUnwindSafe for CommandBuilder
impl Send for CommandBuilder
impl Sync for CommandBuilder
impl Unpin for CommandBuilder
impl UnwindSafe for CommandBuilder
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