embassy-socket 0.1.1

tcp client/server callback
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::err::SocketErr;

/// tcp client callback
pub trait TcpClientCallBack {
    /// connection success call this
    async fn conn(&self);

    /// connection lost call this
    async fn dis_conn(&self);

    /// recv tcp client data call this
    async fn recv(&self, buf: &[u8]);

    /// socket err will call this<br />
    /// only error notification will be made, no blocking and exit will be made<br />
    /// please do not use endless loops in this method
    async fn err(&self, err: SocketErr);
}