Trait HostPollable

Source
pub trait HostPollable: Send {
    // Required methods
    fn ready(
        &mut self,
        self_: Resource<Pollable>,
    ) -> impl Future<Output = Result<bool>> + Send;
    fn block(
        &mut self,
        self_: Resource<Pollable>,
    ) -> impl Future<Output = Result<()>> + Send;
    fn drop(&mut self, rep: Resource<Pollable>) -> Result<()>;
}

Required Methods§

Source

fn ready( &mut self, self_: Resource<Pollable>, ) -> impl Future<Output = Result<bool>> + Send

Return the readiness of a pollable. This function never blocks.

Returns true when the pollable is ready, and false otherwise.

Source

fn block( &mut self, self_: Resource<Pollable>, ) -> impl Future<Output = Result<()>> + Send

block returns immediately if the pollable is ready, and otherwise blocks until ready.

This function is equivalent to calling poll.poll on a list containing only this pollable.

Source

fn drop(&mut self, rep: Resource<Pollable>) -> Result<()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl HostPollable for ResourceTable

Source§

async fn block(&mut self, pollable: Resource<DynPollable>) -> Result<()>

Source§

async fn ready(&mut self, pollable: Resource<DynPollable>) -> Result<bool>

Source§

fn drop(&mut self, pollable: Resource<DynPollable>) -> Result<()>

Source§

impl<_T: HostPollable + ?Sized + Send> HostPollable for &mut _T

Source§

fn ready( &mut self, self_: Resource<Pollable>, ) -> impl Future<Output = Result<bool>> + Send

Return the readiness of a pollable. This function never blocks.

Returns true when the pollable is ready, and false otherwise.

Source§

fn block( &mut self, self_: Resource<Pollable>, ) -> impl Future<Output = Result<()>> + Send

block returns immediately if the pollable is ready, and otherwise blocks until ready.

This function is equivalent to calling poll.poll on a list containing only this pollable.

Source§

fn drop(&mut self, rep: Resource<Pollable>) -> Result<()>

Implementors§