shell::jobs

Struct Jobs

Source
pub struct Jobs { /* private fields */ }

Implementations§

Source§

impl Jobs

Source

pub fn new(interactive: bool) -> Self

Source

pub fn cap_term(&mut self)

Source

pub fn new_job(&mut self) -> Job

Create a new job with the next job number. Note, this new job is NOT in the jobs list.

Source

pub fn push_job(&mut self, job: Job)

Push job onto the list of jobs.

Source

pub fn set_no_tty(&mut self)

Set not on a tty.

Source

pub fn set_interactive(&mut self, interactive: bool)

Sets whether we are interactive or not.

Source

pub fn get_job_mut(&mut self, job_id: u32) -> Option<&mut Job>

Get the mutable job for job_id if it exists.

Source

pub fn reap_procs(&mut self)

Check any pids in a job by calling wait and updating the books.

Source

pub fn foreground_job(&mut self, job_num: u32)

Move the job for job_num to te foreground.

Source

pub fn background_job(&mut self, job_num: u32)

Move the job for job_num to te background and running (start a stopped job in the background).

Source

pub fn restore_terminal(&self)

Restore terminal settings and put the shell back into the foreground.

Source

pub fn get_alias<S: AsRef<str>>(&self, name: S) -> Option<Run>

Gets an alias.

Source

pub fn clear_aliases(&mut self)

Clears all the existing aliases.

Source

pub fn remove_alias<S: AsRef<str>>(&mut self, name: S) -> Option<Run>

Removes the alias name, return the value if removed..

Source

pub fn add_alias(&mut self, name: String, value: String) -> Result<(), Error>

Add an alias.

Source

pub fn add_alias_run(&mut self, name: String, value: Run)

Add an already parsed alias.

Source

pub fn print_alias(&self, name: String)

Print a the alias for name if set.

Source

pub fn print_all_alias(&self)

Print all the defined aliases.

Source

pub fn set_local_var(&mut self, key: OsString, val: OsString)

Set a local var into key. Will overwrite an existing value.

Source

pub fn get_local_var(&self, key: &OsStr) -> Option<&OsStr>

Get the local var key or None if does not exist.

Source

pub fn remove_local_var(&mut self, key: &OsStr) -> Option<OsString>

Remove the local var key. If key exists returns the removed value.

Source

pub fn get_env_or_local_var(&self, key: &OsStr) -> Option<OsString>

First tries to fin key in the environment then checks local variable and returns None if not found.

Trait Implementations§

Source§

impl Display for Jobs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for Jobs

§

impl !RefUnwindSafe for Jobs

§

impl Send for Jobs

§

impl !Sync for Jobs

§

impl Unpin for Jobs

§

impl UnwindSafe for Jobs

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.