Trait Process

Source
pub trait Process: Send + Sized {
    type Stdin: AsyncWrite + Send + Unpin;

    // Required methods
    fn spawn(
        program: &str,
        args: Vec<&str>,
        pipe_output: bool,
    ) -> Result<Self, Error>;
    fn output(
        program: &str,
        args: Vec<&str>,
    ) -> impl Future<Output = Result<Output, Error>> + Send;
    fn take_stdin(&mut self) -> Option<Self::Stdin>;
    fn wait_with_output(
        self,
    ) -> impl Future<Output = Result<Output, Error>> + Send;
}
Expand description

A process backend to use for asynchronous I/O, supporting only the functionality needed by the nftables-async crate.

Required Associated Types§

Required Methods§

Source

fn spawn( program: &str, args: Vec<&str>, pipe_output: bool, ) -> Result<Self, Error>

Source

fn output( program: &str, args: Vec<&str>, ) -> impl Future<Output = Result<Output, Error>> + Send

Source

fn take_stdin(&mut self) -> Option<Self::Stdin>

Source

fn wait_with_output(self) -> impl Future<Output = Result<Output, Error>> + Send

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 Process for AsyncProcess

Available on crate feature async-process only.
Source§

impl Process for TokioProcess

Available on crate feature tokio-process only.