Struct pal::unix::process::Builder

source ·
pub struct Builder<'a> { /* private fields */ }
Expand description

A builder for a child process.

Implementations§

source§

impl<'a> Builder<'a>

source

pub fn new(program: impl Into<PathBuf>) -> Self

Creates a new process builder for program.

source

pub fn arg0(&mut self, arg: impl Into<OsString>) -> &mut Self

Sets argv[0].

source

pub fn arg(&mut self, arg: impl Into<OsString>) -> &mut Self

Appends a command-line argument.

source

pub fn args<I, S>(&mut self, args: I) -> &mut Self
where I: IntoIterator<Item = S>, S: Into<OsString>,

Appends a list of command-line arguments.

source

pub fn env<K, V>(&mut self, key: K, val: V) -> &mut Self
where K: Into<OsString>, V: Into<OsString>,

Sets the environment variable key to val.

source

pub fn env_remove<K: Into<OsString>>(&mut self, key: K) -> &mut Self

Removes the environment variable key.

source

pub fn env_clear(&mut self) -> &mut Self

Clears all environment variables.

source

pub fn stdin(&mut self, stdin: Stdio<'a>) -> &mut Self

Sets the policy for stdin.

source

pub fn stdout(&mut self, stdout: Stdio<'a>) -> &mut Self

Sets the policy for stdout.

source

pub fn stderr(&mut self, stderr: Stdio<'a>) -> &mut Self

Sets the policy for stderr.

source

pub fn close_fd(&mut self, fd: i32) -> &mut Self

Closes fd in the new process.

source

pub fn dup_fd(&mut self, oldfd: BorrowedFd<'a>, newfd: i32) -> &mut Self

Duplicates oldfd to newfd in the new process.

source

pub fn setuid(&mut self, uid: u32) -> &mut Self

Sets the real and effective user id of the new process.

source

pub fn uid(&self) -> Option<u32>

Gets the real and effective user id of the new process.

source

pub fn setgid(&mut self, gid: u32) -> &mut Self

Sets the real and effective group id of the new process.

source

pub fn gid(&self) -> Option<u32>

Gets the real and effective user id of the new process.

source

pub fn set_vfork(&mut self, vfork: bool) -> &mut Self

Sets whether the new process will vfork or not.

source

pub fn vfork(&mut self) -> bool

Gets whether the new process will vfork or not.

source

pub fn set_sandbox_failure_mode( &mut self, mode: SandboxFailureMode, ) -> &mut Self

Sets the sandbox failure mode.

source

pub fn sandbox_failure_mode(&mut self) -> SandboxFailureMode

Gets the sandbox failure mode.

source

pub fn set_permitted_caps(&mut self, caps: CapsHashSet) -> &mut Self

Sets the permitted and inheritable capabilities of the new process.

source

pub fn permitted_caps(&mut self) -> Option<CapsHashSet>

Gets the permitted and inheritable capabilities of the new process.

source

pub fn set_effective_caps(&mut self, caps: CapsHashSet) -> &mut Self

Sets the effective capabilities of the new process.

source

pub fn effective_caps(&mut self) -> Option<CapsHashSet>

Gets the effective capabilities of the new process.

source

pub fn set_ambient_caps(&mut self, caps: CapsHashSet) -> &mut Self

Sets the ambient capabilities of the new process.

source

pub fn ambient_caps(&mut self) -> Option<CapsHashSet>

Gets the ambient capabilities of the new process.

source

pub fn set_inheritable_caps(&mut self, caps: CapsHashSet) -> &mut Self

Sets the inheritable capabilities of the new process.

source

pub fn inheritable_caps(&mut self) -> Option<CapsHashSet>

Gets the inheritable capabilities of the new process.

source

pub fn set_bounding_caps(&mut self, caps: CapsHashSet) -> &mut Self

Sets the bounding capabilities of the new process.

source

pub fn bounding_caps(&mut self) -> Option<CapsHashSet>

Gets the bounding capabilities of the new process.

source

pub fn set_landlock_rules( &mut self, landlock_rules: RulesetCreated, ) -> &mut Self

Sets the landlock ruleset of the new process.

source

pub fn landlock_rules(&mut self) -> Option<RulesetCreated>

Gets the landlock ruleset of the new process.

source

pub fn set_seccomp_filter(&mut self, seccomp_filter: SeccompFilter) -> &mut Self

Sets the seccomp filter for the new process.

source

pub fn seccomp_filter(&mut self) -> Option<SeccompFilter>

Gets the seccomp filter for the new process.

source

pub fn setsid(&mut self, setsid: bool) -> &mut Self

Creates a new session with the new process as the leader.

source

pub fn controlling_terminal( &mut self, controlling_terminal: BorrowedFd<'a>, ) -> &mut Self

Sets the controlling terminal for the new process.

source

pub fn spawn(&self) -> Result<Child>

Spawns the process.

Auto Trait Implementations§

§

impl<'a> Freeze for Builder<'a>

§

impl<'a> RefUnwindSafe for Builder<'a>

§

impl<'a> Send for Builder<'a>

§

impl<'a> Sync for Builder<'a>

§

impl<'a> Unpin for Builder<'a>

§

impl<'a> UnwindSafe for Builder<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more