Trait Notifier

Source
pub trait Notifier {
    type InstantSlot;

    // Required methods
    fn queue(&self);
    fn add_fd(&self, fd: RawFd);
    fn remove_fd(&self, fd: RawFd);
    fn add_instant(&self, instant: Instant) -> Self::InstantSlot;
    fn remove_instant(&self, slot: Self::InstantSlot);
}
Expand description

Implementers and users are responsible for calling fn poll(self, &impl Notifier) on Connections or the states (Connecter, Connectee, ConnecterLocalClosed, etc) as instructed by calls made to it via this trait.

Required Associated Types§

Required Methods§

Source

fn queue(&self)

Poll as soon as possible; equivalent to add_instant(Instant::now()).

Source

fn add_fd(&self, fd: RawFd)

Poll when we receive an edge-triggered event on this file descriptor.

Source

fn remove_fd(&self, fd: RawFd)

No longer poll when we receive events on this file descriptor.

Source

fn add_instant(&self, instant: Instant) -> Self::InstantSlot

Poll at this (typically future) instant.

Source

fn remove_instant(&self, slot: Self::InstantSlot)

No longer poll at this specific previously added instant.

Implementors§