pub trait CompletionPort {
type Error;
// Required methods
fn query(&mut self) -> Result<bool, Self::Error>;
async fn block(&mut self) -> Result<(), Self::Error>;
async fn poll(&mut self) -> Result<(), Self::Error>;
fn arm(&mut self) -> Result<(), Self::Error>;
async fn park(&mut self, bound: DurNs) -> Result<bool, Self::Error>;
}Expand description
One wait on device work, implemented per backend (the core names no vendor). query answers
at once; the others take time and are awaited: a host that runs them on the waiting thread
returns a ready future, an executor’s pend. Errors are the port’s own type and pass through
wait unchanged.
Required Associated Types§
Required Methods§
Sourcefn query(&mut self) -> Result<bool, Self::Error>
fn query(&mut self) -> Result<bool, Self::Error>
The status: Ok(true) done, Ok(false) pending; Err = the work failed.
§Errors
The device reports a failure.
Sourceasync fn poll(&mut self) -> Result<(), Self::Error>
async fn poll(&mut self) -> Result<(), Self::Error>
Park::QueryPoll and the tail of Park::FlagWait: query until done.
§Errors
The device reports a failure.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".