pub struct LaunchSpec { /* private fields */ }Expand description
Everything needed to start a child process.
Secret values are held as SecretString right up to the moment they are
handed to the process API, so no intermediate copy is formattable and the
derived Debug prints the redaction rather than the value.
Implementations§
Source§impl LaunchSpec
impl LaunchSpec
Sourcepub fn with_secrets(
self,
guard: EnvGuard,
secrets: impl IntoIterator<Item = (String, SecretString)>,
) -> Result<Self, LaunchError>
pub fn with_secrets( self, guard: EnvGuard, secrets: impl IntoIterator<Item = (String, SecretString)>, ) -> Result<Self, LaunchError>
Adds secrets to the child’s environment, applying the guard first.
Every name is validated with prick_core::keyname::validate and then
checked against guard. The whole launch fails on the first refusal
rather than dropping the offending variable: a child started with a
silently missing variable is a debugging problem, and a child started
with a silently present one is a breach.
§Errors
Returns LaunchError::InvalidKey for a name that is not usable as an
environment variable, and LaunchError::Guard for one the dynamic
loader or a language runtime interprets.