x11rb::connection

Trait Connection

Source
pub trait Connection: RequestConnection {
    // Required methods
    fn wait_for_raw_event_with_sequence(
        &self,
    ) -> Result<RawEventAndSeqNumber<Self::Buf>, ConnectionError>;
    fn poll_for_raw_event_with_sequence(
        &self,
    ) -> Result<Option<RawEventAndSeqNumber<Self::Buf>>, ConnectionError>;
    fn flush(&self) -> Result<(), ConnectionError>;
    fn setup(&self) -> &Setup;
    fn generate_id(&self) -> Result<u32, ReplyOrIdError>;

    // Provided methods
    fn wait_for_event(&self) -> Result<Event, ConnectionError> { ... }
    fn wait_for_raw_event(&self) -> Result<Self::Buf, ConnectionError> { ... }
    fn wait_for_event_with_sequence(
        &self,
    ) -> Result<EventAndSeqNumber, ConnectionError> { ... }
    fn poll_for_event(&self) -> Result<Option<Event>, ConnectionError> { ... }
    fn poll_for_raw_event(&self) -> Result<Option<Self::Buf>, ConnectionError> { ... }
    fn poll_for_event_with_sequence(
        &self,
    ) -> Result<Option<EventAndSeqNumber>, ConnectionError> { ... }
}
Expand description

A connection to an X11 server.

Required Methods§

Source

fn wait_for_raw_event_with_sequence( &self, ) -> Result<RawEventAndSeqNumber<Self::Buf>, ConnectionError>

Wait for a new raw/unparsed event from the X11 server.

Source

fn poll_for_raw_event_with_sequence( &self, ) -> Result<Option<RawEventAndSeqNumber<Self::Buf>>, ConnectionError>

Poll for a new unparsed/raw event from the X11 server.

Source

fn flush(&self) -> Result<(), ConnectionError>

Send all pending requests to the server.

Implementations of this trait may buffer requests for batched sending. When this method is called, all pending requests are sent.

You do not have to call this method before wait_for_reply(). If the request you want to wait for was not yet sent, it will be sent by wait_for_reply().

Source

fn setup(&self) -> &Setup

Get the setup information sent by the X11 server.

The setup information contains X11 server, for example the window id of the root window.

Source

fn generate_id(&self) -> Result<u32, ReplyOrIdError>

Generate a new X11 identifier.

This method can, for example, be used for creating a new window. First, this method is called to generate an identifier. Next, xproto::create_window can be called to actually create the window.

Provided Methods§

Source

fn wait_for_event(&self) -> Result<Event, ConnectionError>

Wait for a new event from the X11 server.

Source

fn wait_for_raw_event(&self) -> Result<Self::Buf, ConnectionError>

Wait for a new raw/unparsed event from the X11 server.

Source

fn wait_for_event_with_sequence( &self, ) -> Result<EventAndSeqNumber, ConnectionError>

Wait for a new event from the X11 server.

Source

fn poll_for_event(&self) -> Result<Option<Event>, ConnectionError>

Poll for a new event from the X11 server.

Source

fn poll_for_raw_event(&self) -> Result<Option<Self::Buf>, ConnectionError>

Poll for a new raw/unparsed event from the X11 server.

Source

fn poll_for_event_with_sequence( &self, ) -> Result<Option<EventAndSeqNumber>, ConnectionError>

Poll for a new event from the X11 server.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<C: Connection + ToOwned + ?Sized> Connection for Cow<'_, C>

Source§

impl<C: Connection + ?Sized> Connection for &C

Source§

impl<C: Connection + ?Sized> Connection for &mut C

Source§

impl<C: Connection + ?Sized> Connection for Box<C>

Source§

impl<C: Connection + ?Sized> Connection for Rc<C>

Source§

impl<C: Connection + ?Sized> Connection for Arc<C>

Implementors§