Trait UiHandler

Source
pub trait UiHandler {
    // Required methods
    fn read_data<'life0, 'async_trait>(
        &'life0 mut self,
        len: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn read_line<'life0, 'async_trait>(
        &'life0 mut self,
        len: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn write_output<'life0, 'async_trait>(
        &'life0 mut self,
        data: Bytes,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn write_error<'life0, 'async_trait>(
        &'life0 mut self,
        data: Bytes,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Callback to process data and requests received from the server.

Required Methods§

Source

fn read_data<'life0, 'async_trait>( &'life0 mut self, len: usize, ) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handles bulk input request.

Source

fn read_line<'life0, 'async_trait>( &'life0 mut self, len: usize, ) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handles line input request.

Source

fn write_output<'life0, 'async_trait>( &'life0 mut self, data: Bytes, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handles data received through the output channel.

Source

fn write_error<'life0, 'async_trait>( &'life0 mut self, data: Bytes, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handles data received through the error channel.

Implementors§