shell::platform

Struct Sys

Source
pub struct Sys {}

Trait Implementations§

Source§

impl Platform for Sys

Source§

fn get_term_settings(terminal: UnixFileDesc) -> Result<UnixTermSettings, Error>

If terminal is a terminal then get it’s term settings.

Source§

fn restore_terminal( term_settings: &UnixTermSettings, shell_pid: UnixPid, ) -> Result<(), Error>

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

Source§

fn terminal_foreground(terminal: UnixFileDesc)

Put terminal in the foreground, loop until this succeeds. Used during shell startup.

Source§

fn set_self_pgroup() -> Result<(), Error>

Puts the running process into its own process group. Do this during shell initialization.

Source§

fn grab_terminal(terminal: UnixFileDesc) -> Result<(), Error>

Grab control of terminal. Used for shell startup.

Source§

fn anon_pipe() -> Result<(UnixFileDesc, UnixFileDesc), Error>

Return the input and output file descriptors for an anonymous pipe.

Source§

fn close_fd(fd: UnixFileDesc) -> Result<(), Error>

Close a raw Unix file descriptor.

Source§

fn foreground_job( job: &mut Job, term_settings: &Option<UnixTermSettings>, ) -> Result<(), Error>

Move the job for job_num to te foreground.

Source§

fn background_job(job: &mut Job) -> Result<(), Error>

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

Source§

fn dup2_fd( src_fd: UnixFileDesc, dst_fd: UnixFileDesc, ) -> Result<UnixFileDesc, Error>

Duplicate a raw file descriptor to another file descriptor.

Source§

fn getpid() -> UnixPid

Get the current PID.

Source§

fn gethostname() -> Option<OsString>

Get the current machines hostname if available.

Source§

fn current_uid() -> u32

Get current UID of the process.

Source§

fn effective_uid() -> u32

Get effective UID of the process.

Source§

type Pid = UnixPid

Source§

type FileDesc = UnixFileDesc

Source§

type TermSettings = UnixTermSettings

Source§

fn fork_run(run: &Run, job: &mut Job, jobs: &mut Jobs) -> Result<(), Error>

Source§

fn fork_exec( command: &CommandWithArgs, job: &mut Job, jobs: &mut Jobs, ) -> Result<(), Error>

Source§

fn try_wait_pid(pid: UnixPid, job: &mut Job) -> (bool, Option<i32>)

Source§

fn wait_job(job: &mut Job) -> Option<i32>

Source§

fn is_tty(terminal: UnixFileDesc) -> bool

Source§

fn set_rlimit(rlimit: RLimit, values: RLimitVals) -> Result<(), Error>

Source§

fn get_rlimit(rlimit: RLimit) -> Result<RLimitVals, Error>

Source§

fn merge_and_set_umask( current_umask: mode_t, mask_string: &str, ) -> Result<mode_t, Error>

If mask_string is a mode string then merge it with umask and set the current umask. If mask_string is an int then treat it as a umask and set the current umask (no merge)).
Source§

fn get_and_clear_umask() -> mode_t

Clears the current umask and returns the previous umask.
Source§

fn set_umask(umask: mode_t) -> Result<(), Error>

Set current umask to umask.
Source§

fn to_octal_string(mode: mode_t) -> Result<String, Error>

Convert mode to the octal string umask format.

Auto Trait Implementations§

§

impl Freeze for Sys

§

impl RefUnwindSafe for Sys

§

impl Send for Sys

§

impl Sync for Sys

§

impl Unpin for Sys

§

impl UnwindSafe for Sys

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, 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.