Trait AsyncDisplay

Source
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

A non-blocking interface to the X11 server.

This is an asynchronous version of the Display trait. It can do everything that a Display can do, but it doesn’t block and return values. Instead, it returns a Future that can be used to wait for the result.

Required Methods§

Source

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.

Implementations on Foreign Types§

Source§

impl<'lt, D: AsRawFd + DisplayBase> AsyncDisplay for &'lt AsyncFd<D>

Source§

fn poll_for_interest( &mut self, interest: Interest, callback: &mut dyn FnMut(&mut dyn AsyncDisplay, &mut Context<'_>) -> Result<()>, ctx: &mut Context<'_>, ) -> Poll<Result<()>>

Source§

impl<'lt, D: DisplayBase + Source> AsyncDisplay for &'lt Async<D>

Source§

fn poll_for_interest( &mut self, interest: Interest, callback: &mut dyn FnMut(&mut dyn AsyncDisplay, &mut Context<'_>) -> Result<()>, ctx: &mut Context<'_>, ) -> Poll<Result<()>>

Source§

impl<D: AsRawFd + CanBeAsyncDisplay> AsyncDisplay for AsyncFd<D>

Source§

fn poll_for_interest( &mut self, interest: Interest, callback: &mut dyn FnMut(&mut dyn AsyncDisplay, &mut Context<'_>) -> Result<()>, ctx: &mut Context<'_>, ) -> Poll<Result<()>>

Source§

impl<D: AsyncDisplay + ?Sized> AsyncDisplay for &mut D

Source§

fn poll_for_interest( &mut self, interest: Interest, callback: &mut dyn FnMut(&mut dyn AsyncDisplay, &mut Context<'_>) -> Result<()>, ctx: &mut Context<'_>, ) -> Poll<Result<()>>

Source§

impl<D: AsyncDisplay + ?Sized> AsyncDisplay for Box<D>

Source§

fn poll_for_interest( &mut self, interest: Interest, callback: &mut dyn FnMut(&mut dyn AsyncDisplay, &mut Context<'_>) -> Result<()>, ctx: &mut Context<'_>, ) -> Poll<Result<()>>

Source§

impl<D: CanBeAsyncDisplay + Source> AsyncDisplay for Async<D>

Source§

fn poll_for_interest( &mut self, interest: Interest, callback: &mut dyn FnMut(&mut dyn AsyncDisplay, &mut Context<'_>) -> Result<()>, ctx: &mut Context<'_>, ) -> Poll<Result<()>>

Implementors§