Skip to main content

Exec

Trait Exec 

Source
pub trait Exec {
    // Required method
    fn execve(
        &self,
        path: &CStr,
        args: &[CString],
        envs: &[CString],
    ) -> impl Future<Output = Result<Infallible>> + use<Self>;
}
Expand description

Trait for executing a new program in the current process

Required Methods§

Source

fn execve( &self, path: &CStr, args: &[CString], envs: &[CString], ) -> impl Future<Output = Result<Infallible>> + use<Self>

Replaces the current process with an external utility.

This is a thin wrapper around the execve system call.

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§

Source§

impl Exec for RealSystem

Source§

impl Exec for VirtualSystem

Source§

impl<T: Exec> Exec for SharedSystem<T>

Delegates Exec methods to the contained implementor.