pub trait UdpPoller:
Send
+ Sync
+ Debug
+ 'static {
// Required method
fn poll_writable(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<()>>;
}
Expand description
An object polled to detect when an associated AsyncUdpSocket
is writable
Any number of UdpPoller
s may exist for a single AsyncUdpSocket
. Each UdpPoller
is
responsible for notifying at most one task when that socket becomes writable.
Required Methods§
Sourcefn poll_writable(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_writable(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
Check whether the associated socket is likely to be writable
Must be called after AsyncUdpSocket::try_send
returns io::ErrorKind::WouldBlock
to
register the task associated with cx
to be woken when a send should be attempted
again. Unlike in Future::poll
, a UdpPoller
may be reused indefinitely no matter how
many times poll_writable
returns Poll::Ready
.