pub struct Job {
pub id: usize,
pub command_line: String,
pub state: JobState,
/* private fields */
}Expand description
Encapsulates a set of processes managed by the shell as a single unit.
Fields§
§id: usizeThe shell-internal ID of the job.
command_line: StringThe command line of the job.
state: JobStateThe current operational state of the job.
Implementations§
Source§impl Job
impl Job
Sourcepub fn to_pid_style_string(&self) -> String
pub fn to_pid_style_string(&self) -> String
Returns a pid-style string for the job.
Sourcepub fn annotation(&self) -> JobAnnotation
pub fn annotation(&self) -> JobAnnotation
Returns the annotation of the job.
Sourcepub fn command_name(&self) -> &str
pub fn command_name(&self) -> &str
Returns the command name of the job.
Sourcepub const fn is_current(&self) -> bool
pub const fn is_current(&self) -> bool
Returns whether the job is the current job.
Sourcepub fn poll_done(
&mut self,
) -> Result<Option<Result<ExecutionResult, Error>>, Error>
pub fn poll_done( &mut self, ) -> Result<Option<Result<ExecutionResult, Error>>, Error>
Polls whether the job has completed.
Sourcepub async fn wait(&mut self) -> Result<ExecutionResult, Error>
pub async fn wait(&mut self) -> Result<ExecutionResult, Error>
Waits for the job to complete.
Sourcepub fn move_to_background(&mut self) -> Result<(), Error>
pub fn move_to_background(&mut self) -> Result<(), Error>
Moves the job to execute in the background.
Sourcepub fn move_to_foreground(&mut self) -> Result<(), Error>
pub fn move_to_foreground(&mut self) -> Result<(), Error>
Moves the job to execute in the foreground.
Sourcepub fn representative_pid(&self) -> Option<i32>
pub fn representative_pid(&self) -> Option<i32>
Tries to retrieve a “representative” pid for the job.
Sourcepub fn process_group_id(&self) -> Option<i32>
pub fn process_group_id(&self) -> Option<i32>
Tries to retrieve the process group ID (PGID) of the job.
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
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