Skip to main content

Exec

Struct Exec 

Source
pub struct Exec {
    pub program: OsString,
    pub args: Vec<OsString>,
    pub env: Vec<(OsString, OsString)>,
    pub cwd: PathBuf,
    pub stdin: Option<Zeroizing<Vec<u8>>>,
}
Expand description

One spawn request, fully constructed before anything runs.

Fields§

§program: OsString

The program to spawn.

§args: Vec<OsString>

Its arguments; a secret never appears here.

§env: Vec<(OsString, OsString)>

The constructed environment, applied over env_clear.

§cwd: PathBuf

The working directory.

§stdin: Option<Zeroizing<Vec<u8>>>

Bytes written to the child’s stdin, then closed. Scrubbed on drop, because this is the channel a credential travels on.

Implementations§

Source§

impl Exec

Source

pub fn echo(&self) -> String

The one + -prefixed echo line: a rendering of the typed argument list, produced here and never by shell tracing.

Trait Implementations§

Source§

impl Debug for Exec

Source§

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

Everything but stdin: that field carries a credential, and a derived rendering would put it in whatever formatted an Exec.

Auto Trait Implementations§

§

impl Freeze for Exec

§

impl RefUnwindSafe for Exec

§

impl Send for Exec

§

impl Sync for Exec

§

impl Unpin for Exec

§

impl UnsafeUnpin for Exec

§

impl UnwindSafe for Exec

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.