pub trait TcpHandler {
    // Required methods
    fn handler_send<'life0, 'life1, 'async_trait, B>(
        &'life0 mut self,
        message: &'life1 mut B
    ) -> Pin<Box<dyn Future<Output = Result<(), PacketError>> + Send + 'async_trait>>
       where B: 'async_trait + Buf + Send,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn handler_recv<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<BytesMut, PacketError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn handler_send_recv<'life0, 'life1, 'async_trait, B>(
        &'life0 mut self,
        message: &'life1 mut B
    ) -> Pin<Box<dyn Future<Output = Result<BytesMut, PacketError>> + Send + 'async_trait>>
       where B: 'async_trait + Buf + Send,
             Self: Send + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Available on crate feature streams only.
Expand description

The handler trait, providing send and receive methods.

This trait uses [async_trait] so the parameters require Send mark.

Required Methods§

source

fn handler_send<'life0, 'life1, 'async_trait, B>( &'life0 mut self, message: &'life1 mut B ) -> Pin<Box<dyn Future<Output = Result<(), PacketError>> + Send + 'async_trait>>
where B: 'async_trait + Buf + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send a message to the remote.

source

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

Receive a message from the remote.

Provided Methods§

source

fn handler_send_recv<'life0, 'life1, 'async_trait, B>( &'life0 mut self, message: &'life1 mut B ) -> Pin<Box<dyn Future<Output = Result<BytesMut, PacketError>> + Send + 'async_trait>>
where B: 'async_trait + Buf + Send, Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send and receive a message.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<R: AsyncRead + Unpin + Send, W: AsyncWrite + Unpin + Send> TcpHandler for TcpClientHandlerCompress<R, W>

Available on crate feature compression only.
source§

impl<R: AsyncRead + Unpin + Send, W: AsyncWrite + Unpin + Send> TcpHandler for TcpServerHandlerCompress<R, W>

Available on crate feature compression only.
source§

impl<R: AsyncRead + Unpin + Send, W: AsyncWrite + Unpin + Send> TcpHandler for TcpClientHandlerCompressEncrypt<R, W>

Available on crate feature compress_encryption only.
source§

impl<R: AsyncRead + Unpin + Send, W: AsyncWrite + Unpin + Send> TcpHandler for TcpServerHandlerCompressEncrypt<R, W>

Available on crate feature compress_encryption only.
source§

impl<R: AsyncRead + Unpin + Send, W: AsyncWrite + Unpin + Send> TcpHandler for TcpClientHandlerEncrypt<R, W>

Available on crate feature encryption only.
source§

impl<R: AsyncRead + Unpin + Send, W: AsyncWrite + Unpin + Send> TcpHandler for TcpServerHandlerEncrypt<R, W>

Available on crate feature encryption only.
source§

impl<R: AsyncRead + Unpin + Send, W: AsyncWrite + Unpin + Send> TcpHandler for TcpClientHandlerRaw<R, W>

source§

impl<R: AsyncRead + Unpin + Send, W: AsyncWrite + Unpin + Send> TcpHandler for TcpServerHandlerRaw<R, W>