pub struct CommandEnvironment {
pub inherit_process: bool,
pub set: Vec<(OsString, OsString)>,
pub remove: Vec<OsString>,
}Expand description
How a child process should inherit or receive environment variables.
Fields§
§inherit_process: boolWhen true, the child starts from the current process environment (system runner only).
set: Vec<(OsString, OsString)>Variables to set or override (after inherit).
remove: Vec<OsString>Variable names to remove (after inherit and set).
Implementations§
Source§impl CommandEnvironment
impl CommandEnvironment
Sourcepub fn inherit_process_only() -> Self
pub fn inherit_process_only() -> Self
Inherit the process environment with no changes.
Sourcepub fn from_repository_environment(
env: &Environment,
extra: &[(String, String)],
) -> Self
pub fn from_repository_environment( env: &Environment, extra: &[(String, String)], ) -> Self
Build env for a subprocess from an explicit Environment snapshot plus overrides.
The child does not inherit the host process environment; only variables present
on env and extra are exported (extra wins on duplicate keys).
Trait Implementations§
Source§impl Clone for CommandEnvironment
impl Clone for CommandEnvironment
Source§impl Debug for CommandEnvironment
impl Debug for CommandEnvironment
Auto Trait Implementations§
impl Freeze for CommandEnvironment
impl RefUnwindSafe for CommandEnvironment
impl Send for CommandEnvironment
impl Sync for CommandEnvironment
impl Unpin for CommandEnvironment
impl UnsafeUnpin for CommandEnvironment
impl UnwindSafe for CommandEnvironment
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