pub struct Job {
id: u32,
shell_pid: Pid,
pgid: Pid,
pids: Vec<PidStatus>,
names: Vec<String>,
status: JobStatus,
interactive: bool,
stealth: bool,
}
Fields§
§id: u32
§shell_pid: Pid
§pgid: Pid
§pids: Vec<PidStatus>
§names: Vec<String>
§status: JobStatus
§interactive: bool
§stealth: bool
Implementations§
Source§impl Job
impl Job
Sourcepub fn mark_stopped(&mut self)
pub fn mark_stopped(&mut self)
Mark the job as stopped.
Sourcepub fn mark_running(&mut self)
pub fn mark_running(&mut self)
Mark the job as running.
Sourcepub fn add_process(&mut self, pid: Pid, name: impl Into<String>)
pub fn add_process(&mut self, pid: Pid, name: impl Into<String>)
Add pid to list of pids as Running with name. If the pid list is currently empty record this pid as the pgid (process group) for the job.
Sourcepub fn process_done(&mut self, pid: Pid, status: i32)
pub fn process_done(&mut self, pid: Pid, status: i32)
Move the process pid to the done state with status. Will panic if pid is not part of job.
Sourcepub fn process_error(&mut self, pid: Pid)
pub fn process_error(&mut self, pid: Pid)
Move the process pid to the error state. Will panic if pid is not part of job.
Sourcepub fn process_signaled(&mut self, pid: Pid, signal: OsSignal)
pub fn process_signaled(&mut self, pid: Pid, signal: OsSignal)
Move the process pid to the signaled state. Will panic if pid is not part of job.
Sourcepub fn set_stealth(&mut self, stealth: bool)
pub fn set_stealth(&mut self, stealth: bool)
Set the stealth flag, if true then do NOT print out when a background job ends (be stealthy…).
Sourcepub fn stealth(&self) -> bool
pub fn stealth(&self) -> bool
Is this a stealth job (do not report when complete if in the background)?
Sourcepub fn interactive(&self) -> bool
pub fn interactive(&self) -> bool
Is this job running in an interactive shell?
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Job
impl RefUnwindSafe for Job
impl Send for Job
impl Sync for Job
impl Unpin for Job
impl UnwindSafe for Job
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