Trait wasmtime_wasi::bindings::io::poll::HostPollable
source · pub trait HostPollable {
// Required methods
fn ready<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Pollable>,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn block<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Pollable>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn drop(&mut self, rep: Resource<Pollable>) -> Result<()>;
}
Required Methods§
sourcefn ready<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Pollable>,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ready<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Pollable>,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return the readiness of a pollable. This function never blocks.
Returns true
when the pollable is ready, and false
otherwise.
sourcefn block<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Pollable>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn block<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Pollable>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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.
fn drop(&mut self, rep: Resource<Pollable>) -> Result<()>
Implementations on Foreign Types§
source§impl<_T: HostPollable + ?Sized + Send> HostPollable for &mut _T
impl<_T: HostPollable + ?Sized + Send> HostPollable for &mut _T
source§fn ready<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Pollable>,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ready<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Pollable>,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return the readiness of a pollable. This function never blocks.
Returns true
when the pollable is ready, and false
otherwise.
source§fn block<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Pollable>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn block<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Pollable>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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.