shell::command_data

Struct CommandWithArgs

Source
pub struct CommandWithArgs { /* private fields */ }
Expand description

An individual command with args.

Implementations§

Source§

impl CommandWithArgs

Source

pub fn new() -> Self

Create a new empty command and args.

Source

pub fn push_arg(&mut self, arg: Arg)

Push a new arg onto the command, the first “arg” is the command itself.

Source

pub fn push_env_var_arg(&mut self, arg: OsString)

Push a new env var arg onto the command, the first “arg” is the command itself.

Source

pub fn push_run_arg(&mut self, run: Run)

Push a new env var arg onto the command, the first “arg” is the command itself.

Source

pub fn is_empty(&self) -> bool

Empty, not even the command is set.

Source

pub fn command(&self, jobs: &mut Jobs) -> Option<Result<OsString>>

Command name, None if no command name set (args are empty).

Source

pub fn args(&self) -> &[Arg]

Args to the command.

Source

pub fn args_iter(&self) -> CommandArgs<'_>

Iterator over the arguments for the command.

Source

pub fn set_stdios(&mut self, stdios: Redirects)

Set the stdio redirect stack for this command.

Source

pub fn stdios(&self) -> &Option<Redirects>

Set the stdio redirect stack for this command.

Source

pub fn extend_stdios(&mut self, stdios: &Redirects)

Extend the redirect stack for this command with stdio.

Source

pub fn push_stdin_front(&mut self, fd: Option<FileDesc>)

If fd is Some value then put it at the front of the redir queue for this command.

Source

pub fn push_stdout_front(&mut self, fd: Option<FileDesc>)

If fd is Some value then put it at the front of the redir queue for this command.

Source

pub fn process_redirects( &self, jobs: &mut Jobs, ) -> Result<HashSet<FileDesc>, Error>

Process redirects.

Source

pub fn fds_to_internal(&mut self, fd_set: &HashSet<FileDesc>)

Source

pub fn get_internal_fds(&self) -> HashSet<FileDesc>

Return a set of all the ‘internal’ file descriptors (for pipes etc).

Trait Implementations§

Source§

impl Clone for CommandWithArgs

Source§

fn clone(&self) -> CommandWithArgs

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CommandWithArgs

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for CommandWithArgs

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for CommandWithArgs

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.