Skip to main content

Process

Trait Process 

Source
pub trait Process: Sized {
    type Command;
    type Stream;

    // Required methods
    fn spawn<S: AsRef<str>>(cmd: S) -> Result<Self>;
    fn spawn_command(command: Self::Command) -> Result<Self>;
    fn open_stream(&mut self) -> Result<Self::Stream>;
}
Expand description

This trait represents a platform independent process which runs a program.

Required Associated Types§

Source

type Command

A command which process can run.

Source

type Stream

A representation of IO stream of communication with a programm a process is running.

Required Methods§

Source

fn spawn<S: AsRef<str>>(cmd: S) -> Result<Self>

Spawn parses a given string as a commandline string and spawns it on a process.

Source

fn spawn_command(command: Self::Command) -> Result<Self>

Spawn_command runs a process with a given command.

Source

fn open_stream(&mut self) -> Result<Self::Stream>

It opens a IO stream with a spawned process.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§