pub struct Builder<'a> { /* private fields */ }
Expand description
A builder for a child process.
Implementations§
source§impl<'a> Builder<'a>
impl<'a> Builder<'a>
sourcepub fn env<K, V>(&mut self, key: K, val: V) -> &mut Self
pub fn env<K, V>(&mut self, key: K, val: V) -> &mut Self
Sets the environment variable key
to val
.
sourcepub fn env_remove<K: Into<OsString>>(&mut self, key: K) -> &mut Self
pub fn env_remove<K: Into<OsString>>(&mut self, key: K) -> &mut Self
Removes the environment variable key
.
sourcepub fn dup_fd(&mut self, oldfd: BorrowedFd<'a>, newfd: i32) -> &mut Self
pub fn dup_fd(&mut self, oldfd: BorrowedFd<'a>, newfd: i32) -> &mut Self
Duplicates oldfd
to newfd
in the new process.
sourcepub fn setuid(&mut self, uid: u32) -> &mut Self
pub fn setuid(&mut self, uid: u32) -> &mut Self
Sets the real and effective user id of the new process.
sourcepub fn setgid(&mut self, gid: u32) -> &mut Self
pub fn setgid(&mut self, gid: u32) -> &mut Self
Sets the real and effective group id of the new process.
sourcepub fn set_vfork(&mut self, vfork: bool) -> &mut Self
pub fn set_vfork(&mut self, vfork: bool) -> &mut Self
Sets whether the new process will vfork or not.
sourcepub fn set_sandbox_failure_mode(
&mut self,
mode: SandboxFailureMode,
) -> &mut Self
pub fn set_sandbox_failure_mode( &mut self, mode: SandboxFailureMode, ) -> &mut Self
Sets the sandbox failure mode.
sourcepub fn sandbox_failure_mode(&mut self) -> SandboxFailureMode
pub fn sandbox_failure_mode(&mut self) -> SandboxFailureMode
Gets the sandbox failure mode.
sourcepub fn set_permitted_caps(&mut self, caps: CapsHashSet) -> &mut Self
pub fn set_permitted_caps(&mut self, caps: CapsHashSet) -> &mut Self
Sets the permitted and inheritable capabilities of the new process.
sourcepub fn permitted_caps(&mut self) -> Option<CapsHashSet>
pub fn permitted_caps(&mut self) -> Option<CapsHashSet>
Gets the permitted and inheritable capabilities of the new process.
sourcepub fn set_effective_caps(&mut self, caps: CapsHashSet) -> &mut Self
pub fn set_effective_caps(&mut self, caps: CapsHashSet) -> &mut Self
Sets the effective capabilities of the new process.
sourcepub fn effective_caps(&mut self) -> Option<CapsHashSet>
pub fn effective_caps(&mut self) -> Option<CapsHashSet>
Gets the effective capabilities of the new process.
sourcepub fn set_ambient_caps(&mut self, caps: CapsHashSet) -> &mut Self
pub fn set_ambient_caps(&mut self, caps: CapsHashSet) -> &mut Self
Sets the ambient capabilities of the new process.
sourcepub fn ambient_caps(&mut self) -> Option<CapsHashSet>
pub fn ambient_caps(&mut self) -> Option<CapsHashSet>
Gets the ambient capabilities of the new process.
sourcepub fn set_inheritable_caps(&mut self, caps: CapsHashSet) -> &mut Self
pub fn set_inheritable_caps(&mut self, caps: CapsHashSet) -> &mut Self
Sets the inheritable capabilities of the new process.
sourcepub fn inheritable_caps(&mut self) -> Option<CapsHashSet>
pub fn inheritable_caps(&mut self) -> Option<CapsHashSet>
Gets the inheritable capabilities of the new process.
sourcepub fn set_bounding_caps(&mut self, caps: CapsHashSet) -> &mut Self
pub fn set_bounding_caps(&mut self, caps: CapsHashSet) -> &mut Self
Sets the bounding capabilities of the new process.
sourcepub fn bounding_caps(&mut self) -> Option<CapsHashSet>
pub fn bounding_caps(&mut self) -> Option<CapsHashSet>
Gets the bounding capabilities of the new process.
sourcepub fn set_landlock_rules(
&mut self,
landlock_rules: RulesetCreated,
) -> &mut Self
pub fn set_landlock_rules( &mut self, landlock_rules: RulesetCreated, ) -> &mut Self
Sets the landlock ruleset of the new process.
sourcepub fn landlock_rules(&mut self) -> Option<RulesetCreated>
pub fn landlock_rules(&mut self) -> Option<RulesetCreated>
Gets the landlock ruleset of the new process.
sourcepub fn set_seccomp_filter(&mut self, seccomp_filter: SeccompFilter) -> &mut Self
pub fn set_seccomp_filter(&mut self, seccomp_filter: SeccompFilter) -> &mut Self
Sets the seccomp filter for the new process.
sourcepub fn seccomp_filter(&mut self) -> Option<SeccompFilter>
pub fn seccomp_filter(&mut self) -> Option<SeccompFilter>
Gets the seccomp filter for the new process.
sourcepub fn setsid(&mut self, setsid: bool) -> &mut Self
pub fn setsid(&mut self, setsid: bool) -> &mut Self
Creates a new session with the new process as the leader.
sourcepub fn controlling_terminal(
&mut self,
controlling_terminal: BorrowedFd<'a>,
) -> &mut Self
pub fn controlling_terminal( &mut self, controlling_terminal: BorrowedFd<'a>, ) -> &mut Self
Sets the controlling terminal for the new process.