pub struct ProcessPromise { /* private fields */ }Expand description
Implementations§
Source§impl ProcessPromise
impl ProcessPromise
Sourcepub fn failed(opts: Options, err: ZxError) -> Self
pub fn failed(opts: Options, err: ZxError) -> Self
A command that fails immediately with err when run.
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Kill the command after timeout (with the timeout signal).
Sourcepub fn timeout_with(self, timeout: Duration, signal: impl Into<String>) -> Self
pub fn timeout_with(self, timeout: Duration, signal: impl Into<String>) -> Self
Kill the command after timeout with signal.
Sourcepub fn kill_signal(self, signal: impl Into<String>) -> Self
pub fn kill_signal(self, signal: impl Into<String>) -> Self
Default signal for RunningProcess::kill.
Sourcepub fn pipe(self, dest: ProcessPromise) -> ProcessPromise
pub fn pipe(self, dest: ProcessPromise) -> ProcessPromise
Feed this command’s stdout into dest’s stdin; returns dest.
When this command fails (and is not nothrow) the destination is
stopped and inherits its exit code, so the pipeline fails as a whole.
Sourcepub fn pipe_stderr(self, dest: ProcessPromise) -> ProcessPromise
pub fn pipe_stderr(self, dest: ProcessPromise) -> ProcessPromise
Feed this command’s stderr into dest.
Sourcepub fn pipe_stdall(self, dest: ProcessPromise) -> ProcessPromise
pub fn pipe_stdall(self, dest: ProcessPromise) -> ProcessPromise
Feed this command’s interleaved stdout and stderr into dest.
Sourcepub fn pipe_from(self, from: PipeFrom, dest: ProcessPromise) -> ProcessPromise
pub fn pipe_from(self, from: PipeFrom, dest: ProcessPromise) -> ProcessPromise
Feed the selected stream into dest. If dest already has a source,
this command is attached at the head of its pipeline.
Sourcepub async fn pipe_to_file(self, path: impl AsRef<Path>) -> ZxResult
pub async fn pipe_to_file(self, path: impl AsRef<Path>) -> ZxResult
Run the command writing its stdout into the file at path.
Sourcepub async fn pipe_to_file_from(
self,
from: PipeFrom,
path: impl AsRef<Path>,
) -> ZxResult
pub async fn pipe_to_file_from( self, from: PipeFrom, path: impl AsRef<Path>, ) -> ZxResult
Run the command writing the selected stream into the file at path.
Sourcepub fn run_sync(self) -> ZxResult
pub fn run_sync(self) -> ZxResult
Run the command synchronously (on a helper thread with its own runtime, so it is safe to call from inside or outside of tokio).
Sourcepub fn spawn(self) -> RunningProcess
pub fn spawn(self) -> RunningProcess
Start the command in the background (requires a tokio runtime).
Trait Implementations§
Source§impl Clone for ProcessPromise
impl Clone for ProcessPromise
Source§impl Debug for ProcessPromise
impl Debug for ProcessPromise
Source§impl IntoFuture for ProcessPromise
impl IntoFuture for ProcessPromise
Source§type Output = Result<ProcessOutput, ProcessOutput>
type Output = Result<ProcessOutput, ProcessOutput>
Source§type IntoFuture = Pin<Box<dyn Future<Output = Result<ProcessOutput, ProcessOutput>> + Send>>
type IntoFuture = Pin<Box<dyn Future<Output = Result<ProcessOutput, ProcessOutput>> + Send>>
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Auto Trait Implementations§
impl Freeze for ProcessPromise
impl RefUnwindSafe for ProcessPromise
impl Send for ProcessPromise
impl Sync for ProcessPromise
impl Unpin for ProcessPromise
impl UnsafeUnpin for ProcessPromise
impl UnwindSafe for ProcessPromise
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.