pub struct ProcessBuilder { /* private fields */ }Expand description
A configurable process invocation — Laravel’s Process::run() / builder.
Implementations§
Source§impl ProcessBuilder
impl ProcessBuilder
pub fn new(command: impl Into<String>) -> Self
Sourcepub fn path(self, path: impl Into<String>) -> Self
pub fn path(self, path: impl Into<String>) -> Self
Working directory for the process — Laravel’s Process::path().
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Kill the process after the given duration — Laravel’s Process::timeout().
Sourcepub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
Set an environment variable — Laravel’s Process::env().
Sourcepub async fn run(&self) -> Result<ProcessResult>
pub async fn run(&self) -> Result<ProcessResult>
Run the process and wait for it to finish, capturing output.
Sourcepub async fn background(&self) -> Result<Child>
pub async fn background(&self) -> Result<Child>
Start the process in the background and return a handle to it.
Auto Trait Implementations§
impl Freeze for ProcessBuilder
impl RefUnwindSafe for ProcessBuilder
impl Send for ProcessBuilder
impl Sync for ProcessBuilder
impl Unpin for ProcessBuilder
impl UnsafeUnpin for ProcessBuilder
impl UnwindSafe for ProcessBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more