Skip to main content

ExecExt

Trait ExecExt 

Source
pub trait ExecExt {
    // Required methods
    fn setuid(self, uid: u32) -> Self;
    fn setgid(self, gid: u32) -> Self;
}
Expand description

Extension trait for Unix-specific process creation options.

Required Methods§

Source

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

Set the user ID for the spawned process.

The child process will run with the specified user ID, which affects file access permissions and process ownership. This calls setuid(2) in the child process after fork() but before exec().

Source

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

Set the group ID for the spawned process.

The child process will run with the specified group ID, which affects file access permissions based on group ownership. This calls setgid(2) in the child process after fork() but before exec().

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§