pub struct ChildEnvironment { /* private fields */ }Expand description
The complete environment one harness child is launched with.
“Complete” is the whole point: a spawner applying this clears the child’s environment
first, so Self::pairs is not an overlay on an inherited set — it IS the set.
Implementations§
Source§impl ChildEnvironment
impl ChildEnvironment
Sourcepub fn pairs(&self) -> &[(String, String)]
pub fn pairs(&self) -> &[(String, String)]
The resolved (name, value) pairs — the child’s entire environment.
Sourcepub fn absent(&self) -> &[String]
pub fn absent(&self) -> &[String]
The declared names that the launching context did not carry, so a launcher can report them rather than let a silently-absent credential surface as an agent failure three layers down.
Sourcepub fn require_for_program(
&self,
program: &Path,
) -> Result<(), EnvironmentError>
pub fn require_for_program( &self, program: &Path, ) -> Result<(), EnvironmentError>
Refuses the launch when program cannot be executed under this environment,
naming the variable that is missing.
The one mechanically decidable case is program lookup: a program written without a
path separator is resolved on PATH, and a child with no PATH cannot resolve it.
An absolute or relative path needs no lookup and is not gated here — the operator’s
hermetic, PATH-free declaration is legitimate and stays legitimate.
§Errors
Returns EnvironmentError::MissingForExec naming PATH when program needs a
lookup this environment cannot perform.
Trait Implementations§
Source§impl Clone for ChildEnvironment
impl Clone for ChildEnvironment
Source§fn clone(&self) -> ChildEnvironment
fn clone(&self) -> ChildEnvironment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more