iroh_quinn

Trait UdpPoller

Source
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 UdpPollers may exist for a single AsyncUdpSocket. Each UdpPoller is responsible for notifying at most one task when that socket becomes writable.

Required Methods§

Source

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.

Implementors§