Connection

Trait Connection 

Source
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.

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.

Implementors§