Module breadx::display [−][src]
Expand description
This module provides the bulk of the utilities used to communicate with the X11 server.
Although one can just connect to the X server using your average TcpStream or UnixStream and communicate
that way, it tends to be very inconvenient to deal in terms of bytes and not the actual types. This module
aims to provide types to simplify dealings with the X server.
Note that this module is unpacked into the crate root, so that any item in this module can also be used from the crate directly.
DisplayBase, Display and AsyncDisplay
- The
DisplayBasetrait is implemented for objects that communicate with the X server. It provides non-IO functionality like keeping track of pending items and setup information. - The
Displaytrait is implemented for objects that communicate with the X server in a blocking manner. It provides functions likewait_for_eventandsend_request, although you’re more likely to use functions on its extension traits. - The
AsyncDisplaytrait is implemented for objects that communication with the X server in a non-blocking manner. It is similar to theDisplaytrait and tries to mirror its functionality.
Display Implementors
By default, this module provides the BasicDisplay and CellDisplay types, which allow for mutable
and immutable access, respectively. Both implement DisplayBase, Display, and AsyncDisplay. If you
enable the sync-display feature, you will also gain access to the [SyncDisplay] type, which allows for
immutable and thread-safe usage.
Connection, AsyncConnection, and NameConnection
The Connection and AsyncConnection traits are implemented for the raw connection types that the
Display implementors wrap themselves around, like TcpStream and UnixStream. However, you are most
likely to use the NameConnection, since it represents a connection to the X server
resolved from the server’s name.
Modules
This module defines the NameConnection type, which is the default connection used for Display objects.
See the NameConnection object for more information.
A set of traits to import to enable functionality.
Traits and objects used to give displays functionality.
Structs
An implementor of Display and AsyncDisplay that requires &mut access in order to use.
An implementor of Display and AsyncDisplay that uses Cell and RefCell in order to allow
for immutable use of the Display. The primary downside is that it is not Sync.
A set of parameters used to create or change a graphics context.
The future returned by get_image_immediate_async.
A mapping from keycodes to keysyms.
A simple future that maps one value onto another using a closure.
A reply, pending returning from the display. This contains the data of the reply, as well as any file descriptors.
A request, pending reply from the server. It contains the request number of the request as well as extra flags determining how it should be handled by the display.
Flags indicating how the request/reply should be handled by the display.
The future returned by AsyncConnectionExt::read_packet.
A cookie for a request.
Request information, monomorphized from the Request trait.
The future returned by AsyncConnectionExt::send_packet.
The future returned by the AsyncDisplayExt::send_request_async method. It is a basic wrapper around
sending the raw request.
The future returned by send_request_raw_async. This polls the AsyncDisplay instance until it
returns properly.
The future created by the AsyncDisplayExt::wait_async method; runs the poll_wait function until
it returns Ready.
A set of parameters used to create or change a window.
Enums
The result of a color allocation call.
Run one future or the other.
Future returned by establish_async.
The future returned by the AsyncDisplayExt::request_exchange_async function.
An ExchangeRequestFuture, but it potentially returns an XID.
Combines PendingRequest, PendingReply, and BreadError into one type, to simplify some of the APIs.
Utility type to represent a polling result that returns another object if it fails.
The future returned by the put_image_async function.
Which workaround we have to use when we receive the reply bytes from the server.
The future returned by AsyncDisplayExt::resolve_request_async.
The future returned by AsyncDisplayExt::synchronize_async, which sends a simple request and then
waits for a reply to appear.
Traits
Asynchronous breadx connection.
Extension trait for AsyncConnection that provides futures.
A wrapper around an asynchronous connection to the X server.
Monomorphized methods we can’t put into the AsyncDisplay trait proper.
Synchronous breadx connection.
A wrapper around a synchronous connection to the X11 server.
This trait represents a connection to the X11 server. Most operations in breadx revolve around an object
implementing this trait in some way, shape, or form.
Monomorphized methods we can’t put into the Display trait proper.
Functions
Convenience function for producing an RGB pixel value for supported monitors.
Type Definitions
DisplayConnection, but using an async connection type instead of the standard blocking one.
A variant of BasicDisplay that uses X11’s default connection mechanisms to connect to the server. In
most cases, you should be using either this, or converting this type to a CellDisplay or SyncDisplay.
The future returned by AsyncDisplayExt::ResolveRequestRaw.
A Screen where all of its lists are guaranteed to live forever (i.e. it owns all of its lists).
A Setup where all of its lists are guaranteed to live forever (i.e. it owns all of its lists).
The future returned by AsyncDisplayExt::wait_for_event_async.
The future returned by AsyncDisplayExt::WaitForSpecialEvent.