Trait Handler

Source
pub trait Handler: Send {
    type Reader: AsyncRead + Unpin + Send + 'static;
    type Writer: AsyncWrite + Unpin + Send + 'static;

    // Required methods
    fn read_req_open<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        client: &'life1 SocketAddr,
        path: &'life2 Path,
    ) -> Pin<Box<dyn Future<Output = Result<(Self::Reader, Option<u64>), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn write_req_open<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        client: &'life1 SocketAddr,
        path: &'life2 Path,
        size: Option<u64>,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Writer, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Trait for implementing advance handlers.

Required Associated Types§

Source

type Reader: AsyncRead + Unpin + Send + 'static

Source

type Writer: AsyncWrite + Unpin + Send + 'static

Required Methods§

Source

fn read_req_open<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, client: &'life1 SocketAddr, path: &'life2 Path, ) -> Pin<Box<dyn Future<Output = Result<(Self::Reader, Option<u64>), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Open Reader to serve a read request.

Source

fn write_req_open<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, client: &'life1 SocketAddr, path: &'life2 Path, size: Option<u64>, ) -> Pin<Box<dyn Future<Output = Result<Self::Writer, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Open Writer to serve a write request.

Implementors§