[−][src]Struct libuv::handles::process::ProcessHandle
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]
&mut self,
r#loop: &Loop,
options: ProcessOptions<'_>
) -> Result<(), Box<dyn Error>>
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]
fn clone(&self) -> ProcessHandle
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for ProcessHandle
[src]
impl From<ProcessHandle> for Handle
[src]
fn from(process: ProcessHandle) -> Handle
[src]
impl HandleTrait for ProcessHandle
[src]
fn is_active(&self) -> bool
[src]
fn is_closing(&self) -> bool
[src]
fn close<CB: Into<CloseCB<'static>>>(&mut self, cb: CB)
[src]
fn ref(&mut self)
[src]
fn unref(&mut self)
[src]
fn has_ref(&self) -> bool
[src]
fn send_buffer_size(&mut self, value: i32) -> Result<i32>
[src]
fn recv_buffer_size(&mut self, value: i32) -> Result<i32>
[src]
fn get_fileno(&self) -> Result<OsFile>
[src]
fn get_loop(&self) -> Loop
[src]
fn get_type(&self) -> HandleType
[src]
impl ToHandle for ProcessHandle
[src]
impl TryFrom<Handle> for ProcessHandle
[src]
Auto Trait Implementations
impl RefUnwindSafe for ProcessHandle
impl !Send for ProcessHandle
impl !Sync for ProcessHandle
impl Unpin for ProcessHandle
impl UnwindSafe for ProcessHandle
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,