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§
type Reader: AsyncRead + Unpin + Send + 'static
type Writer: AsyncWrite + Unpin + Send + 'static
Required Methods§
Sourcefn 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 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.
Sourcefn 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,
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.