Trait HostPollable
pub trait HostPollable: Send {
// Required methods
fn ready(
&mut self,
self_: Resource<DynPollable>,
) -> impl Future<Output = Result<bool, Error>> + Send;
fn block(
&mut self,
self_: Resource<DynPollable>,
) -> impl Future<Output = Result<(), Error>> + Send;
fn drop(&mut self, rep: Resource<DynPollable>) -> Result<(), Error>;
}Available on crate feature
component-model-async only.Required Methods§
fn ready(
&mut self,
self_: Resource<DynPollable>,
) -> impl Future<Output = Result<bool, Error>> + Send
fn ready( &mut self, self_: Resource<DynPollable>, ) -> impl Future<Output = Result<bool, Error>> + Send
Return the readiness of a pollable. This function never blocks.
Returns true when the pollable is ready, and false otherwise.
fn block(
&mut self,
self_: Resource<DynPollable>,
) -> impl Future<Output = Result<(), Error>> + Send
fn block( &mut self, self_: Resource<DynPollable>, ) -> impl Future<Output = Result<(), Error>> + 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.
fn drop(&mut self, rep: Resource<DynPollable>) -> Result<(), Error>
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§
§impl HostPollable for ResourceTable
impl HostPollable for ResourceTable
§impl<_T> HostPollable for &mut _T
impl<_T> HostPollable for &mut _T
§fn ready(
&mut self,
self_: Resource<DynPollable>,
) -> impl Future<Output = Result<bool, Error>> + Send
fn ready( &mut self, self_: Resource<DynPollable>, ) -> impl Future<Output = Result<bool, Error>> + Send
Return the readiness of a pollable. This function never blocks.
Returns true when the pollable is ready, and false otherwise.
§fn block(
&mut self,
self_: Resource<DynPollable>,
) -> impl Future<Output = Result<(), Error>> + Send
fn block( &mut self, self_: Resource<DynPollable>, ) -> impl Future<Output = Result<(), Error>> + 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.