pub struct JobTable { /* private fields */ }Expand description
A table of active jobs.
Implementations§
Source§impl JobTable
impl JobTable
Sourcepub fn add(&mut self, pid: Pid, pgid: Pid, command: String) -> usize
pub fn add(&mut self, pid: Pid, pgid: Pid, command: String) -> usize
Add a new job and return its id.
Sourcepub fn find_by_pid(&self, pid: Pid) -> Option<&Job>
pub fn find_by_pid(&self, pid: Pid) -> Option<&Job>
Look up a job by its leader PID.
Sourcepub fn wait_for(&mut self, id: usize) -> Option<JobStatus>
pub fn wait_for(&mut self, id: usize) -> Option<JobStatus>
Wait for a specific job to finish or stop.
Returns the final status. Updates the job entry in-place.
Sourcepub fn reap_finished(&mut self) -> Vec<usize>
pub fn reap_finished(&mut self) -> Vec<usize>
Non-blocking reap of any finished jobs.
Sourcepub fn prune_done(&mut self)
pub fn prune_done(&mut self)
Remove all jobs that have completed (Done or Signaled).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JobTable
impl RefUnwindSafe for JobTable
impl Send for JobTable
impl Sync for JobTable
impl Unpin for JobTable
impl UnsafeUnpin for JobTable
impl UnwindSafe for JobTable
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