Trait Driver

Source
pub trait Driver {
    // Required method
    fn run_process(
        program: &OsStr,
        args: &[&OsStr],
        stdin: Option<&[u8]>,
    ) -> impl Future<Output = Result<Output, Error>> + Send;
}
Expand description

A process driver internally used by the helper to run the “nft” process asynchronously, write to its stdin and retrieve its output.

Required Methods§

Source

fn run_process( program: &OsStr, args: &[&OsStr], stdin: Option<&[u8]>, ) -> impl Future<Output = Result<Output, Error>> + Send

Run the provided program with the provided arguments and retrieve its output. If stdin is None, stdin should be nulled by the driver and no interaction should occur with the process. If stdin is Some, stdin should be piped and the byte payload as well as a subsequent EOF (closure of the pipe) should be transmitted before the process is waited on.

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 Driver for AsyncProcessDriver

Available on crate feature async-process only.
Source§

impl Driver for TokioDriver

Available on crate feature tokio-process only.