pub trait DisplayBase {
    fn setup(&self) -> &Arc<Setup>;
    fn default_screen_index(&self) -> usize;
    fn poll_for_reply_raw(&mut self, seq: u64) -> Result<Option<RawReply>>;
    fn poll_for_event(&mut self) -> Result<Option<Event>>;

    fn screens(&self) -> &[Screen] { ... }
    fn default_screen(&self) -> &Screen { ... }
}
Expand description

An interface to the X11 server, containing functionality that is neither inherently synchronous nor asynchronous.

This trait is the supertrait for both Display and AsyncDisplay. It only contains functions for retrieving the setup information and for polling the server in a non-blocking manner.

These functions should be used if, for instance, you want to fetch an event, but if it is not available you need to do something else instead. In addition, Setup information is useful for determining screen parameters, among other things.

Required Methods

Get the Setup associated with this display.

The Setup contains a variety of information that is useful for determining aspects of the currently available environment. This includes screen size, the maximum length of a request, keycodes, and more.

Get the screen associated with this display.

At startup time, the default screen to use in the process is determined by the user. This is the index of that screen.

Poll to see if a reply matching the sequence number has been received.

This checks the reply map to see if a reply has been received for the given sequence number. If it has, it returns the reply. Otherwise, it tries to fetch it from the server.

Blocking

This function should never block. Non-blocking I/O should be used to fetch the reply, and None should be returned if the call would block.

Poll to see if we have received an event.

This checks the event queue to see if an event has been received. If it has, it returns the event. Otherwise, it tries to fetch it from the server.

Blocking

This function should never block. Non-blocking I/O should be used to fetch the event, and None should be returned if the call would block.

Provided Methods

Get the screens for this display.

This is equivalent to self.setup().roots, but is marginally more convenient.

Get the default screen for this display.

This is equivalent to self.setup().roots[self.default_screen_index()].

Implementations on Foreign Types

Implementors