Trait SubprocessHandler

Source
pub trait SubprocessHandler: Send {
    // Required methods
    fn write_bytes(
        &mut self,
        input: &[u8],
    ) -> impl Future<Output = Result<()>> + Send;
    fn read_bytes(&mut self) -> impl Future<Output = Result<Vec<u8>>> + Send;
    fn read_bytes_until(
        &mut self,
        delimiter: u8,
    ) -> impl Future<Output = Result<Vec<u8>>> + Send;
    fn is_alive(&mut self) -> bool;
    fn close_stdin(&mut self);

    // Provided methods
    fn write(&mut self, input: &str) -> impl Future<Output = Result<()>> + Send { ... }
    fn write_line(
        &mut self,
        input: &str,
    ) -> impl Future<Output = Result<()>> + Send { ... }
    fn read(&mut self) -> impl Future<Output = Result<String>> + Send { ... }
    fn read_until(
        &mut self,
        delimiter: u8,
    ) -> impl Future<Output = Result<String>> + Send { ... }
    fn read_line(&mut self) -> impl Future<Output = Result<String>> + Send { ... }
}

Required Methods§

Source

fn write_bytes( &mut self, input: &[u8], ) -> impl Future<Output = Result<()>> + Send

Source

fn read_bytes(&mut self) -> impl Future<Output = Result<Vec<u8>>> + Send

Source

fn read_bytes_until( &mut self, delimiter: u8, ) -> impl Future<Output = Result<Vec<u8>>> + Send

Source

fn is_alive(&mut self) -> bool

Source

fn close_stdin(&mut self)

Provided Methods§

Source

fn write(&mut self, input: &str) -> impl Future<Output = Result<()>> + Send

Source

fn write_line(&mut self, input: &str) -> impl Future<Output = Result<()>> + Send

Source

fn read(&mut self) -> impl Future<Output = Result<String>> + Send

Source

fn read_until( &mut self, delimiter: u8, ) -> impl Future<Output = Result<String>> + Send

Source

fn read_line(&mut self) -> impl Future<Output = Result<String>> + 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§