Display

Trait Display 

Source
pub trait Display: DisplayBase {
    // Required methods
    fn send_request_raw(&mut self, req: RawRequest<'_, '_>) -> Result<u64>;
    fn wait_for_reply_raw(&mut self, seq: u64) -> Result<RawReply>;
    fn wait_for_event(&mut self) -> Result<Event>;
    fn maximum_request_length(&mut self) -> Result<usize>;
    fn generate_xid(&mut self) -> Result<u32>;
    fn check_for_error(&mut self, seq: u64) -> Result<()>;
    fn flush(&mut self) -> Result<()>;

    // Provided method
    fn synchronize(&mut self) -> Result<()> { ... }
}
Expand description

A blocking interface to the X11 server.

This interface can be used to do everything that DisplayBase can do, but it is also capable of blocking on I/O. This allows it to send requests, receive replies/events, among other things.

Objects of this type should never be put into non-blocking mode.

Required Methods§

Source

fn send_request_raw(&mut self, req: RawRequest<'_, '_>) -> Result<u64>

Send a raw request to the X11 server.

This function formats req, sends it to the server, and returns the sequence number associated with that request.

§Blocking

This function should block until the request has been sent to the server.

Source

fn wait_for_reply_raw(&mut self, seq: u64) -> Result<RawReply>

Wait for a reply from the X11 server.

This function waits for a reply to the given sequence number.

Note that if the request has no reply, this function will likely hang forever.

§Blocking

This function should block until a reply is received from the server.

Source

fn wait_for_event(&mut self) -> Result<Event>

Wait for an event.

This function waits for an event to be received from the server.

§Blocking

This function should block until an event is received from the server.

Source

fn maximum_request_length(&mut self) -> Result<usize>

Get the maximum request length that can be sent.

Returned in units of 4 bytes.

§Blocking

The server may be using the Big Requests extension, which allows for requests to be larger than the default maximum request length. If so, this function will block until the server has updated its maximum request length.

Source

fn generate_xid(&mut self) -> Result<u32>

Get a unique ID valid for use by the server.

This function returns a unique ID that can be used by the server to identify the client’s resources.

§Blocking

If the client has exhausted its XID range, this function will block until the server has repopulated it.

Source

fn check_for_error(&mut self, seq: u64) -> Result<()>

Check for an error for the given sequence number.

This is intended to be used for void requests. For all other requests, either an error will occur or the reply will be discarded.

Source

fn flush(&mut self) -> Result<()>

Flush all pending requests to the server.

§Blocking

This function should block until all pending requests have been sent to the server.

Provided Methods§

Source

fn synchronize(&mut self) -> Result<()>

Synchronize this display with the server.

By default, this function sends and receives a low-cost request. This is useful for ensuring that the server has “caught up” with the client.

Implementations on Foreign Types§

Source§

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

Source§

fn send_request_raw(&mut self, req: RawRequest<'_, '_>) -> Result<u64>

Source§

fn wait_for_event(&mut self) -> Result<Event>

Source§

fn wait_for_reply_raw(&mut self, seq: u64) -> Result<RawReply>

Source§

fn flush(&mut self) -> Result<()>

Source§

fn synchronize(&mut self) -> Result<()>

Source§

fn generate_xid(&mut self) -> Result<u32>

Source§

fn maximum_request_length(&mut self) -> Result<usize>

Source§

fn check_for_error(&mut self, seq: u64) -> Result<()>

Source§

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

Source§

fn send_request_raw(&mut self, req: RawRequest<'_, '_>) -> Result<u64>

Source§

fn maximum_request_length(&mut self) -> Result<usize>

Source§

fn flush(&mut self) -> Result<()>

Source§

fn generate_xid(&mut self) -> Result<u32>

Source§

fn synchronize(&mut self) -> Result<()>

Source§

fn wait_for_event(&mut self) -> Result<Event>

Source§

fn wait_for_reply_raw(&mut self, seq: u64) -> Result<RawReply>

Source§

fn check_for_error(&mut self, seq: u64) -> Result<()>

Implementors§

Source§

impl<Conn: Connection> Display for BasicDisplay<Conn>

Source§

impl<Dpy: Display + ?Sized> Display for &CellDisplay<Dpy>

Source§

impl<Dpy: Display + ?Sized> Display for &SyncDisplay<Dpy>

Source§

impl<Dpy: Display + ?Sized> Display for CellDisplay<Dpy>

Source§

impl<Dpy: Display + ?Sized> Display for SyncDisplay<Dpy>