pub struct Process<Loc> {
pub tag: &'static str,
pub cmd: Cmd<Loc>,
pub timeout: KillTimeout,
}
Expand description
Long running process. Can be constructed via Process::new
or convenience process!
macro.
Fields§
§tag: &'static str
Tag used as an identificator in output when process runs as a part of a ProcessPool
.
cmd: Cmd<Loc>
Command to run a process.
timeout: KillTimeout
Amount of time to wait before killing hanged process. See KillTimeout
.
Implementations§
source§impl<Loc> Process<Loc>where
Loc: Location,
impl<Loc> Process<Loc>where
Loc: Location,
sourcepub fn new(tag: &'static str, cmd: Cmd<Loc>, timeout: KillTimeout) -> Self
pub fn new(tag: &'static str, cmd: Cmd<Loc>, timeout: KillTimeout) -> Self
Constructs a new process.
sourcepub fn timeout(&self) -> &KillTimeout
pub fn timeout(&self) -> &KillTimeout
Returns a timeout of a process.
sourcepub async fn spawn(&self, opts: SpawnOptions) -> Result<RunningProcess>
pub async fn spawn(&self, opts: SpawnOptions) -> Result<RunningProcess>
Spawns a process and returns a RunningProcess
,
which includes a Child
.
Auto Trait Implementations§
impl<Loc> Freeze for Process<Loc>where
Loc: Freeze,
impl<Loc> RefUnwindSafe for Process<Loc>where
Loc: RefUnwindSafe,
impl<Loc> Send for Process<Loc>where
Loc: Send,
impl<Loc> Sync for Process<Loc>where
Loc: Sync,
impl<Loc> Unpin for Process<Loc>where
Loc: Unpin,
impl<Loc> UnwindSafe for Process<Loc>where
Loc: UnwindSafe,
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