pub trait Host: HostPollable {
// Required methods
fn poll_list<'life0, 'async_trait>(
&'life0 mut self,
in_: Vec<Resource<Pollable>>
) -> Pin<Box<dyn Future<Output = Result<Vec<u32>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn poll_one<'life0, 'async_trait>(
&'life0 mut self,
in_: Resource<Pollable>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Required Methods§
sourcefn poll_list<'life0, 'async_trait>(
&'life0 mut self,
in_: Vec<Resource<Pollable>>
) -> Pin<Box<dyn Future<Output = Result<Vec<u32>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn poll_list<'life0, 'async_trait>(
&'life0 mut self,
in_: Vec<Resource<Pollable>>
) -> Pin<Box<dyn Future<Output = Result<Vec<u32>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Poll for completion on a set of pollables.
This function takes a list of pollables, which identify I/O sources of interest, and waits until one or more of the events is ready for I/O.
The result list<u32>
contains one or more indices of handles in the
argument list that is ready for I/O.
If the list contains more elements than can be indexed with a u32
value, this function traps.
A timeout can be implemented by adding a pollable from the wasi-clocks API to the list.
This function does not return a result
; polling in itself does not
do any I/O so it doesn’t fail. If any of the I/O sources identified by
the pollables has an error, it is indicated by marking the source as
being reaedy for I/O.
sourcefn poll_one<'life0, 'async_trait>(
&'life0 mut self,
in_: Resource<Pollable>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn poll_one<'life0, 'async_trait>(
&'life0 mut self,
in_: Resource<Pollable>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Poll for completion on a single pollable.
This function is similar to poll-list
, but operates on only a single
pollable. When it returns, the handle is ready for I/O.