pub trait AsyncDisplay: CanBeAsyncDisplay {
// Required method
fn poll_for_interest(
&mut self,
interest: Interest,
callback: &mut dyn FnMut(&mut dyn AsyncDisplay, &mut Context<'_>) -> Result<()>,
ctx: &mut Context<'_>,
) -> Poll<Result<()>>;
}
Expand description
Required Methods§
Sourcefn poll_for_interest(
&mut self,
interest: Interest,
callback: &mut dyn FnMut(&mut dyn AsyncDisplay, &mut Context<'_>) -> Result<()>,
ctx: &mut Context<'_>,
) -> Poll<Result<()>>
fn poll_for_interest( &mut self, interest: Interest, callback: &mut dyn FnMut(&mut dyn AsyncDisplay, &mut Context<'_>) -> Result<()>, ctx: &mut Context<'_>, ) -> Poll<Result<()>>
Poll for an interest. If the interest if ready, call the provided callback.
This function is used to drive I/O. It should be called whenever the runtime is ready to wait on I/O, and should be implemented as follows:
- Poll for the specific interest.
- If the interest is ready, call the given callback.
- Otherwise, return
Pending
.