Trait RequestConnection

Source
pub trait RequestConnection: Sync {
    type Buf: AsRef<[u8]> + Debug + Send + Sync + 'static;

Show 20 methods // Required methods fn send_request_with_reply<'this, 'bufs, 'sl, 're, 'future, R>( &'this self, bufs: &'bufs [IoSlice<'sl>], fds: Vec<OwnedFd>, ) -> Pin<Box<dyn Future<Output = Result<Cookie<'this, Self, R>, ConnectionError>> + Send + 'future>> where R: TryParse + Send + 're, 'this: 'future, 'bufs: 'future, 'sl: 'future, 're: 'future; fn send_request_with_reply_with_fds<'this, 'bufs, 'sl, 're, 'future, R>( &'this self, bufs: &'bufs [IoSlice<'sl>], fds: Vec<OwnedFd>, ) -> Pin<Box<dyn Future<Output = Result<CookieWithFds<'this, Self, R>, ConnectionError>> + Send + 'future>> where R: TryParseFd + Send + 're, 'this: 'future, 'bufs: 'future, 'sl: 'future, 're: 'future; fn send_request_without_reply<'this, 'bufs, 'sl, 'future>( &'this self, bufs: &'bufs [IoSlice<'sl>], fds: Vec<OwnedFd>, ) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'this, Self>, ConnectionError>> + Send + 'future>> where 'this: 'future, 'bufs: 'future, 'sl: 'future; fn discard_reply( &self, sequence: SequenceNumber, kind: RequestKind, mode: DiscardMode, ); fn prefetch_extension_information( &self, name: &'static str, ) -> Pin<Box<dyn Future<Output = Result<(), ConnectionError>> + Send + '_>>; fn extension_information( &self, name: &'static str, ) -> Pin<Box<dyn Future<Output = Result<Option<ExtensionInformation>, ConnectionError>> + Send + '_>>; fn wait_for_reply_or_raw_error( &self, sequence: SequenceNumber, ) -> Pin<Box<dyn Future<Output = Result<ReplyOrError<Self::Buf>, ConnectionError>> + Send + '_>>; fn wait_for_reply( &self, sequence: SequenceNumber, ) -> Pin<Box<dyn Future<Output = Result<Option<Self::Buf>, ConnectionError>> + Send + '_>>; fn wait_for_reply_with_fds_raw( &self, sequence: SequenceNumber, ) -> Pin<Box<dyn Future<Output = Result<ReplyOrError<BufWithFds<Self::Buf>, Self::Buf>, ConnectionError>> + Send + '_>>; fn check_for_raw_error( &self, sequence: SequenceNumber, ) -> Pin<Box<dyn Future<Output = Result<Option<Self::Buf>, ConnectionError>> + Send + '_>>; fn prefetch_maximum_request_bytes( &self, ) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>; fn maximum_request_bytes( &self, ) -> Pin<Box<dyn Future<Output = usize> + Send + '_>>; fn parse_error(&self, error: &[u8]) -> Result<X11Error, ParseError>; fn parse_event(&self, event: &[u8]) -> Result<Event, ParseError>; // Provided methods fn send_trait_request_with_reply<'this, 'req, 'future, R>( &'this self, request: R, ) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, R::Reply>, ConnectionError>> + Send + 'future>> where R: ReplyRequest + Send + 'req, R::Reply: Send, 'this: 'future, 'req: 'future { ... } fn send_trait_request_with_reply_with_fds<'this, 'req, 'future, R>( &'this self, request: R, ) -> Pin<Box<dyn Future<Output = Result<CookieWithFds<'_, Self, R::Reply>, ConnectionError>> + Send + 'future>> where R: ReplyFDsRequest + Send + 'req, R::Reply: Send, 'this: 'future, 'req: 'future { ... } fn send_trait_request_without_reply<'this, 'req, 'future, R>( &'this self, request: R, ) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'this, Self>, ConnectionError>> + Send + 'future>> where R: VoidRequest + Send + 'req, 'this: 'future, 'req: 'future { ... } fn wait_for_reply_or_error( &self, sequence: SequenceNumber, ) -> Pin<Box<dyn Future<Output = Result<Self::Buf, ReplyError>> + Send + '_>> { ... } fn wait_for_reply_with_fds( &self, sequence: SequenceNumber, ) -> Pin<Box<dyn Future<Output = Result<BufWithFds<Self::Buf>, ReplyError>> + Send + '_>> { ... } fn check_for_error( &self, sequence: SequenceNumber, ) -> Pin<Box<dyn Future<Output = Result<(), ReplyError>> + Send + '_>> { ... }
}
Expand description

A connection to an X11 server for sending requests.

Required Associated Types§

Source

type Buf: AsRef<[u8]> + Debug + Send + Sync + 'static

Type used as buffer to store raw replies or events before they are parsed.

Required Methods§

Source

fn send_request_with_reply<'this, 'bufs, 'sl, 're, 'future, R>( &'this self, bufs: &'bufs [IoSlice<'sl>], fds: Vec<OwnedFd>, ) -> Pin<Box<dyn Future<Output = Result<Cookie<'this, Self, R>, ConnectionError>> + Send + 'future>>
where R: TryParse + Send + 're, 'this: 'future, 'bufs: 'future, 'sl: 'future, 're: 'future,

Send a request with a reply to the server.

This is the async analog of x11rb::connection::RequestConnection::send_request_with_reply, and is semantically equivalent to:

async fn send_request_with_reply<R: TryParse>(
    &self,
    bufs: &[IoSlice],
    fds: Vec<RawFdContainer>
) -> Result<Cookie<'_, Self, R>, ConnectionError>
Source

fn send_request_with_reply_with_fds<'this, 'bufs, 'sl, 're, 'future, R>( &'this self, bufs: &'bufs [IoSlice<'sl>], fds: Vec<OwnedFd>, ) -> Pin<Box<dyn Future<Output = Result<CookieWithFds<'this, Self, R>, ConnectionError>> + Send + 'future>>
where R: TryParseFd + Send + 're, 'this: 'future, 'bufs: 'future, 'sl: 'future, 're: 'future,

Send a request with a reply containing file descriptors to the server.

This is the async analog of x11rb::connection::RequestConnection::send_request_with_reply_with_fds, and is semantically equivalent to:

async fn send_request_with_reply_with_fds<R: TryParseFd>(
    &self,
    bufs: &[IoSlice],
    fds: Vec<RawFdContainer>,
) -> Result<CookieWithFds<'_, Self, R>, ConnectionError>
Source

fn send_request_without_reply<'this, 'bufs, 'sl, 'future>( &'this self, bufs: &'bufs [IoSlice<'sl>], fds: Vec<OwnedFd>, ) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'this, Self>, ConnectionError>> + Send + 'future>>
where 'this: 'future, 'bufs: 'future, 'sl: 'future,

Send a request without a reply to the server.

This is the async analog of x11rb::connection::RequestConnection::send_request_without_reply, and is semantically equivalent to:

async fn send_request_without_reply(
    &self,
    bufs: &[IoSlice],
    fds: Vec<RawFdContainer>,
) -> Result<VoidCookie<'_, Self>, ConnectionError>
Source

fn discard_reply( &self, sequence: SequenceNumber, kind: RequestKind, mode: DiscardMode, )

The reply for this request shoiuld be discarded.

Source

fn prefetch_extension_information( &self, name: &'static str, ) -> Pin<Box<dyn Future<Output = Result<(), ConnectionError>> + Send + '_>>

Prefetch information about an extension.

This is the async analog of x11rb::connection::RequestConnection::prefetch_extension_information, and is semantically equivalent to:

async fn prefetch_extension_information(&self, name: &'static str) -> Result<(), ConnectionError>
Source

fn extension_information( &self, name: &'static str, ) -> Pin<Box<dyn Future<Output = Result<Option<ExtensionInformation>, ConnectionError>> + Send + '_>>

Get information about an extension.

This is the async analog of x11rb::connection::RequestConnection::extension_information, and is semantically equivalent to:

async fn extension_information(&self, name: &'static str)
    -> Result<Option<ExtensionInformation>, ConnectionError>
Source

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

Wait for the reply to a request.

This is the async analog of x11rb::connection::RequestConnection::wait_for_reply_or_raw_error, and is semantically equivalent to:

async fn wait_for_reply_or_raw_error(
    &self,
    sequence: SequenceNumber,
) -> Result<ReplyOrError<Self::Buf>, ConnectionError>
Source

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

Wait for the reply to a request.

This is the async analog of x11rb::connection::RequestConnection::wait_for_reply, and is semantically equivalent to:

async fn wait_for_reply(
    &self,
    sequence: SequenceNumber,
) -> Result<Option<Self::Buf>, ConnectionError>
Source

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

Wait for the reply to a request with file descriptors.

This is the async analog of x11rb::connection::RequestConnection::wait_for_reply_with_fds_raw, and is semantically equivalent to:

async fn wait_for_reply_with_fds_raw(
    &self,
    sequence: SequenceNumber,
) -> Result<ReplyOrError<BufWithFds<Self::Buf>, Self::Buf>, ConnectionError>
Source

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

Check whether a request has errored.

This is the async analog of x11rb::connection::RequestConnection::check_for_raw_error, and is semantically equivalent to:

async fn check_for_raw_error(
    &self,
    sequence: SequenceNumber,
) -> Result<Option<Self::Buf>, ConnectionError>
Source

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

Prefetches the maximum request length.

This is the async analog of x11rb::connection::RequestConnection::prefetch_maximum_request_bytes, and is semantically equivalent to:

async fn prefetch_maximum_request_bytes(&self)
Source

fn maximum_request_bytes( &self, ) -> Pin<Box<dyn Future<Output = usize> + Send + '_>>

Get the maximum request length.

This is the async analog of x11rb::connection::RequestConnection::maximum_request_bytes, and is semantically equivalent to:

async fn maximum_request_bytes(&self) -> usize
Source

fn parse_error(&self, error: &[u8]) -> Result<X11Error, ParseError>

Parse a generic error.

Source

fn parse_event(&self, event: &[u8]) -> Result<Event, ParseError>

Parse a generic event.

Provided Methods§

Source

fn send_trait_request_with_reply<'this, 'req, 'future, R>( &'this self, request: R, ) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, R::Reply>, ConnectionError>> + Send + 'future>>
where R: ReplyRequest + Send + 'req, R::Reply: Send, 'this: 'future, 'req: 'future,

Send a request with a reply to the server.

Rather than sending raw bytes, this method sends the trait object.

This is the async analog of x11rb::connection::RequestConnection::send_trait_request_with_reply, and is semantically equivalent to:

async fn send_trait_request_with_reply<R: ReplyRequest>(
    &self,
    request: R
) -> Result<Cookie<'_, Self, R::Reply>, ConnectionError>
Source

fn send_trait_request_with_reply_with_fds<'this, 'req, 'future, R>( &'this self, request: R, ) -> Pin<Box<dyn Future<Output = Result<CookieWithFds<'_, Self, R::Reply>, ConnectionError>> + Send + 'future>>
where R: ReplyFDsRequest + Send + 'req, R::Reply: Send, 'this: 'future, 'req: 'future,

Send a request with a reply containing file descriptors to the server.

Rather than sending raw bytes, this method sends the trait object.

This is the async analog of x11rb::connection::RequestConnection::send_trait_request_with_reply_with_fds, and is semantically equivalent to:

async fn send_trait_request_with_reply_with_fds<R: ReplyFDsRequest>(
    &self,
    request: R
) -> Result<CookieWithFds<'_, Self, R::Reply>, ConnectionError>
Source

fn send_trait_request_without_reply<'this, 'req, 'future, R>( &'this self, request: R, ) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'this, Self>, ConnectionError>> + Send + 'future>>
where R: VoidRequest + Send + 'req, 'this: 'future, 'req: 'future,

Send a request without a reply to the server.

Rather than sending raw bytes, this method sends the trait object.

This is the async analog of x11rb::connection::RequestConnection::send_trait_request_without_reply, and is semantically equivalent to:

async fn send_trait_request_without_reply<R: VoidRequest>(
    &self,
    request: R
) -> Result<VoidCookie<'_, Self>, ConnectionError>
Source

fn wait_for_reply_or_error( &self, sequence: SequenceNumber, ) -> Pin<Box<dyn Future<Output = Result<Self::Buf, ReplyError>> + Send + '_>>

Wait for the reply to a request.

This is the async analog of x11rb::connection::RequestConnection::wait_for_reply_or_error, and is semantically equivalent to:

async fn wait_for_reply_or_error(
    &self,
    sequence: SequenceNumber,
) -> Result<ReplyOrError<Self::Buf>, ConnectionError>
Source

fn wait_for_reply_with_fds( &self, sequence: SequenceNumber, ) -> Pin<Box<dyn Future<Output = Result<BufWithFds<Self::Buf>, ReplyError>> + Send + '_>>

Wait for the reply to a request with file descriptors.

This is the async analog of x11rb::connection::RequestConnection::wait_for_reply_with_fds, and is semantically equivalent to:

async fn wait_for_reply_with_fds(
    &self,
    sequence: SequenceNumber,
) -> Result<BufWithFds<Self::Buf>, ConnectionError>
Source

fn check_for_error( &self, sequence: SequenceNumber, ) -> Pin<Box<dyn Future<Output = Result<(), ReplyError>> + Send + '_>>

Check whether a request has errored.

This is the async analog of x11rb::connection::RequestConnection::check_for_error, and is semantically equivalent to:

async fn check_for_error(
    &self,
    sequence: SequenceNumber,
) -> Result<(), ReplyError>

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§