pub trait AsyncSendTo {
type Error;
// Required method
fn poll_send_to(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8],
addr: SocketAddr,
) -> Poll<Result<usize, Self::Error>>;
}
Expand description
This is intended for async datagram IO.
Required Associated Types§
Required Methods§
Sourcefn poll_send_to(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8],
addr: SocketAddr,
) -> Poll<Result<usize, Self::Error>>
fn poll_send_to( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], addr: SocketAddr, ) -> Poll<Result<usize, Self::Error>>
A non-blocking, poll-based variant of std::net::UdpSocket::send_to
.
This doesn’t have to be implemented as async. The implementation
for std::net::UdpSocket
is blocking.