StreamableCommand

Trait StreamableCommand 

Source
pub trait StreamableCommand: Send + Sync {
    // Required methods
    fn stream<'life0, 'async_trait, F>(
        &'life0 self,
        handler: F,
    ) -> Pin<Box<dyn Future<Output = Result<StreamResult>> + Send + 'async_trait>>
       where F: FnMut(OutputLine) + Send + 'static + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn stream_channel<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(Receiver<OutputLine>, StreamResult)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for commands that support streaming output

Required Methods§

Source

fn stream<'life0, 'async_trait, F>( &'life0 self, handler: F, ) -> Pin<Box<dyn Future<Output = Result<StreamResult>> + Send + 'async_trait>>
where F: FnMut(OutputLine) + Send + 'static + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Run the command with streaming output

§Errors

Returns an error if the command fails to spawn or encounters an I/O error

Source

fn stream_channel<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(Receiver<OutputLine>, StreamResult)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Run the command with streaming output via a channel

§Errors

Returns an error if the command fails to spawn or encounters an I/O error

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§