pub trait Connection: RequestConnection {
    // Required methods
    fn wait_for_raw_event_with_sequence(
        &self
    ) -> Pin<Box<dyn Future<Output = Result<RawEventAndSeqNumber<Self::Buf>, ConnectionError>> + Send + '_>>;
    fn poll_for_raw_event_with_sequence(
        &self
    ) -> Result<Option<RawEventAndSeqNumber<Self::Buf>>, ConnectionError>;
    fn flush(
        &self
    ) -> Pin<Box<dyn Future<Output = Result<(), ConnectionError>> + Send + '_>>;
    fn setup(&self) -> &Setup;
    fn generate_id(
        &self
    ) -> Pin<Box<dyn Future<Output = Result<u32, ReplyOrIdError>> + Send + '_>>;

    // Provided methods
    fn wait_for_event(
        &self
    ) -> Pin<Box<dyn Future<Output = Result<Event, ConnectionError>> + Send + '_>> { ... }
    fn wait_for_raw_event(
        &self
    ) -> Pin<Box<dyn Future<Output = Result<Self::Buf, ConnectionError>> + Send + '_>> { ... }
    fn wait_for_event_with_sequence(
        &self
    ) -> Pin<Box<dyn Future<Output = Result<EventAndSeqNumber, ConnectionError>> + Send + '_>> { ... }
    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

An asynchronous connection to an X11 server.

Required Methods§

source

fn wait_for_raw_event_with_sequence( &self ) -> Pin<Box<dyn Future<Output = Result<RawEventAndSeqNumber<Self::Buf>, ConnectionError>> + Send + '_>>

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

This is the async analog of x11rb::connection::Connection::wait_for_raw_event, and is semantically equivalent to:

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

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

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

source

fn flush( &self ) -> Pin<Box<dyn Future<Output = Result<(), ConnectionError>> + Send + '_>>

Flush the output buffer.

source

fn setup(&self) -> &Setup

Get the setup information of the connection.

source

fn generate_id( &self ) -> Pin<Box<dyn Future<Output = Result<u32, ReplyOrIdError>> + Send + '_>>

Generate a new X11 identifier.

This is the async analog of x11rb::connection::Connection::generate_id, and is the semantic equivalent to:

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

Provided Methods§

source

fn wait_for_event( &self ) -> Pin<Box<dyn Future<Output = Result<Event, ConnectionError>> + Send + '_>>

Wait for a new event from the X11 server.

This is the async analog of x11rb::connection::Connection::wait_for_event, and is semantically equivalent to:

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

fn wait_for_raw_event( &self ) -> Pin<Box<dyn Future<Output = Result<Self::Buf, ConnectionError>> + Send + '_>>

Wait for a new event from the X11 server.

This is the async analog of x11rb::connection::Connection::wait_for_raw_event, and is semantically equivalent to:

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

fn wait_for_event_with_sequence( &self ) -> Pin<Box<dyn Future<Output = Result<EventAndSeqNumber, ConnectionError>> + Send + '_>>

Wait for a new event from the X11 server.

This is the async analog of x11rb::connection::Connection::wait_for_event_with_sequence, and is semantically equivalent to:

async fn wait_for_event_with_sequence(
    &self,
    sequence: SequenceNumber,
) -> Result<EventAndSeqNumber, ConnectionError>
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 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.

Object Safety§

This trait is not object safe.

Implementors§