[][src]Struct libuv::handles::process::ProcessHandle

pub struct ProcessHandle { /* fields omitted */ }

Process handles will spawn a new process and allow the user to control it and establish communication channels with it using streams.

Implementations

impl ProcessHandle[src]

pub fn new() -> Result<ProcessHandle>[src]

Create a new process handle

pub fn disable_stdio_inheritance()[src]

Disables inheritance for file descriptors / handles that this process inherited from its parent. The effect is that child processes spawned by this process don’t accidentally inherit these handles.

It is recommended to call this function as early in your program as possible, before the inherited file descriptors can be closed or duplicated.

Note: This function works on a best-effort basis: there is no guarantee that libuv can discover all file descriptors that were inherited. In general it does a better job on Windows than it does on Unix.

pub fn spawn(
    &mut self,
    r#loop: &Loop,
    options: ProcessOptions<'_>
) -> Result<(), Box<dyn Error>>
[src]

Initializes the process handle and starts the process.

Possible reasons for failing to spawn would include (but not be limited to) the file to execute not existing, not having permissions to use the setuid or setgid specified, or not having enough memory to allocate for the new process.

pub fn pid(&self) -> i32[src]

The PID of the spawned process. It’s set after calling spawn().

pub fn kill(&mut self, signum: i32) -> Result<()>[src]

Sends the specified signal to the given process handle. Check the documentation on SignalHandle for signal support, specially on Windows.

pub fn kill_pid(pid: i32, signum: i32) -> Result<()>[src]

Sends the specified signal to the given PID. Check the documentation on SignalHandle for signal support, specially on Windows.

Trait Implementations

impl Clone for ProcessHandle[src]

impl Copy for ProcessHandle[src]

impl From<ProcessHandle> for Handle[src]

impl HandleTrait for ProcessHandle[src]

impl ToHandle for ProcessHandle[src]

impl TryFrom<Handle> for ProcessHandle[src]

type Error = ConversionError

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.