TcpClientCallBack

Trait TcpClientCallBack 

Source
pub trait TcpClientCallBack {
    // Required methods
    async fn conn(&self);
    async fn dis_conn(&self);
    async fn recv(&self, buf: &[u8]);
    async fn err(&self, err: SocketErr);
}
Expand description

tcp client callback

Required Methods§

Source

async fn conn(&self)

connection success call this

Source

async fn dis_conn(&self)

connection lost call this

Source

async fn recv(&self, buf: &[u8])

recv tcp client data call this

Source

async fn err(&self, err: SocketErr)

socket err will call this
only error notification will be made, no blocking and exit will be made
please do not use endless loops in this method

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§