pub trait TcpServerCallBack {
type T;
// Required methods
async fn conn<const CN: usize>(
&self,
endpoint: IpEndpoint,
wch: &WriteChannel<'_, CN>,
t: &mut Self::T,
);
async fn dis_conn(&self, endpoint: IpEndpoint, t: &mut Self::T);
async fn recv<const CN: usize>(
&self,
endpoint: IpEndpoint,
buf: &[u8],
wch: &WriteChannel<'_, CN>,
t: &mut Self::T,
);
async fn err(&self, err: SocketErr, t: &mut Self::T);
}
Expand description
tcp server callback
Required Associated Types§
Required Methods§
Sourceasync fn conn<const CN: usize>(
&self,
endpoint: IpEndpoint,
wch: &WriteChannel<'_, CN>,
t: &mut Self::T,
)
async fn conn<const CN: usize>( &self, endpoint: IpEndpoint, wch: &WriteChannel<'_, CN>, t: &mut Self::T, )
connection success call this
Sourceasync fn dis_conn(&self, endpoint: IpEndpoint, t: &mut Self::T)
async fn dis_conn(&self, endpoint: IpEndpoint, t: &mut Self::T)
connection lost call this
Sourceasync fn recv<const CN: usize>(
&self,
endpoint: IpEndpoint,
buf: &[u8],
wch: &WriteChannel<'_, CN>,
t: &mut Self::T,
)
async fn recv<const CN: usize>( &self, endpoint: IpEndpoint, buf: &[u8], wch: &WriteChannel<'_, CN>, t: &mut Self::T, )
recv tcp client data call this
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.