pub trait AsyncDatagram {
type Sender;
type Receiver;
type Err;
// Required methods
fn poll_send_to(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8],
receiver: &Self::Receiver,
) -> Poll<Result<usize, Self::Err>>;
fn poll_recv_from(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut [u8],
) -> Poll<Result<(usize, Self::Sender), Self::Err>>;
}
Expand description
Implement a datagram protocol.