embassy_socket/tcp_client/
callback.rs

1use crate::err::SocketErr;
2
3/// tcp client callback
4pub trait TcpClientCallBack {
5    /// connection success call this
6    async fn conn(&self);
7
8    /// connection lost call this
9    async fn dis_conn(&self);
10
11    /// recv tcp client data call this
12    async fn recv(&self, buf: &[u8]);
13
14    /// socket err will call this<br />
15    /// only error notification will be made, no blocking and exit will be made<br />
16    /// please do not use endless loops in this method
17    async fn err(&self, err: SocketErr);
18}