pub struct NativeOverrides {
pub working_dir: Option<String>,
pub shell: Option<String>,
pub path_additions: Vec<String>,
pub run_as: Option<String>,
pub clear_env: bool,
pub inherit_env: bool,
}Expand description
Native execution overrides.
Fields§
§working_dir: Option<String>Working directory.
shell: Option<String>Shell to use.
path_additions: Vec<String>PATH additions.
run_as: Option<String>Run as different user.
clear_env: boolClear environment before execution.
inherit_env: boolInherit environment from parent.
Implementations§
Source§impl NativeOverrides
impl NativeOverrides
Sourcepub fn with_working_dir(self, dir: impl Into<String>) -> Self
pub fn with_working_dir(self, dir: impl Into<String>) -> Self
Set working directory.
Sourcepub fn with_shell(self, shell: impl Into<String>) -> Self
pub fn with_shell(self, shell: impl Into<String>) -> Self
Set shell.
Sourcepub fn with_path_addition(self, path: impl Into<String>) -> Self
pub fn with_path_addition(self, path: impl Into<String>) -> Self
Add to PATH.
Sourcepub fn with_run_as(self, user: impl Into<String>) -> Self
pub fn with_run_as(self, user: impl Into<String>) -> Self
Run as user.
Sourcepub fn with_clear_env(self) -> Self
pub fn with_clear_env(self) -> Self
Clear environment before execution.
Sourcepub fn without_inherit_env(self) -> Self
pub fn without_inherit_env(self) -> Self
Don’t inherit environment.
Sourcepub fn shell_or_default(&self) -> &str
pub fn shell_or_default(&self) -> &str
Get the shell to use, with a default.
Sourcepub fn build_path(&self, existing_path: Option<&str>) -> String
pub fn build_path(&self, existing_path: Option<&str>) -> String
Build the PATH environment variable.
Trait Implementations§
Source§impl Clone for NativeOverrides
impl Clone for NativeOverrides
Source§fn clone(&self) -> NativeOverrides
fn clone(&self) -> NativeOverrides
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NativeOverrides
impl Debug for NativeOverrides
Source§impl Default for NativeOverrides
impl Default for NativeOverrides
Source§impl<'de> Deserialize<'de> for NativeOverrides
impl<'de> Deserialize<'de> for NativeOverrides
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for NativeOverrides
impl RefUnwindSafe for NativeOverrides
impl Send for NativeOverrides
impl Sync for NativeOverrides
impl Unpin for NativeOverrides
impl UnwindSafe for NativeOverrides
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