Trait pal_async::wait::PollWait

source ·
pub trait PollWait:
    Unpin
    + Send
    + Sync
    + AsAny {
    // Required methods
    fn poll_wait(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>;
    fn poll_cancel_wait(&mut self, cx: &mut Context<'_>) -> Poll<bool>;
}
Expand description

A trait for polling the state of waits.

Required Methods§

source

fn poll_wait(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>

Polls a wait for completion, consuming the object’s wait signal.

Depending on the wait object, this may fail. For platform events (e.g., eventfd on Linux, and NT events on Windows), this cannot fail.

source

fn poll_cancel_wait(&mut self, cx: &mut Context<'_>) -> Poll<bool>

Cancels a polled wait.

Returns true if the wait signal was consumed.

Trait Implementations§

source§

impl Debug for dyn PollWait

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementors§

source§

impl<T: 'static + PollFdReady> PollWait for FdWait<T>