winit::platform_impl::linux::x11

Type Alias X11rbConnection

Source
type X11rbConnection = XCBConnection;
Expand description

The underlying x11rb connection that we are using.

Aliased Type§

struct X11rbConnection { /* private fields */ }

Implementations

Source§

impl XCBConnection

Source

pub fn connect( dpy_name: Option<&CStr>, ) -> Result<(XCBConnection, usize), ConnectError>

Establish a new connection to an X11 server.

If a dpy_name is provided, it describes the display that should be connected to, for example 127.0.0.1:1. If no value is provided, the $DISPLAY environment variable is used.

Source

pub unsafe fn from_raw_xcb_connection( ptr: *mut c_void, should_drop: bool, ) -> Result<XCBConnection, ConnectError>

Create a connection wrapper for a raw libxcb xcb_connection_t.

xcb_disconnect is called on drop only if should_drop is true. If this function returns an Err() and should_drop was true, then xcb_disconnect was already called.

§Safety

If should_drop is false, the connection must live longer than the returned XCBConnection. If should_drop is true, the returned XCBConnection will take the ownership of the connection.

Source

pub fn has_error(&self) -> Option<ConnectionError>

Check if the underlying XCB connection is in an error state.

Source

pub fn get_raw_xcb_connection(&self) -> *mut c_void

Get access to the raw libxcb xcb_connection_t.

The returned pointer is valid for as long as the original object was not dropped. No ownerhsip is transferred.

Trait Implementations

Source§

impl AsFd for XCBConnection

Source§

fn as_fd(&self) -> BorrowedFd<'_>

Borrows the file descriptor. Read more
Source§

impl AsRawFd for XCBConnection

Source§

fn as_raw_fd(&self) -> i32

Extracts the raw file descriptor. Read more
Source§

impl AsRawXcbConnection for XCBConnection

Source§

fn as_raw_xcb_connection(&self) -> *mut xcb_connection_t

Get a raw xcb connection pointer from this object.
Source§

impl Connection for XCBConnection

Source§

fn wait_for_raw_event_with_sequence( &self, ) -> Result<(<XCBConnection as RequestConnection>::Buf, u64), ConnectionError>

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

fn poll_for_raw_event_with_sequence( &self, ) -> Result<Option<(<XCBConnection as RequestConnection>::Buf, u64)>, 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. Read more
Source§

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

Generate a new X11 identifier. Read more
Source§

fn setup(&self) -> &Setup

Get the setup information sent by the X11 server. Read more
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<(Event, u64), 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<(Event, u64)>, ConnectionError>

Poll for a new event from the X11 server.
Source§

impl Debug for XCBConnection

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl RequestConnection for XCBConnection

Source§

type Buf = CSlice

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

fn send_request_with_reply<R>( &self, bufs: &[IoSlice<'_>], fds: Vec<OwnedFd>, ) -> Result<Cookie<'_, XCBConnection, R>, ConnectionError>
where R: TryParse,

Send a request with a reply to the server. Read more
Source§

fn send_request_with_reply_with_fds<R>( &self, bufs: &[IoSlice<'_>], fds: Vec<OwnedFd>, ) -> Result<CookieWithFds<'_, XCBConnection, R>, ConnectionError>
where R: TryParseFd,

Send a request with a reply containing file descriptors to the server. Read more
Source§

fn send_request_without_reply( &self, bufs: &[IoSlice<'_>], fds: Vec<OwnedFd>, ) -> Result<VoidCookie<'_, XCBConnection>, ConnectionError>

Send a request without a reply to the server. Read more
Source§

fn discard_reply(&self, sequence: u64, _kind: RequestKind, mode: DiscardMode)

A reply to an error should be discarded. Read more
Source§

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

Prefetches information about an extension. Read more
Source§

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

Get information about an extension. Read more
Source§

fn wait_for_reply_or_raw_error( &self, sequence: u64, ) -> Result<ReplyOrError<CSlice>, ConnectionError>

Wait for the reply to a request. Read more
Source§

fn wait_for_reply( &self, sequence: u64, ) -> Result<Option<CSlice>, ConnectionError>

Wait for the reply to a request. Read more
Source§

fn wait_for_reply_with_fds_raw( &self, sequence: u64, ) -> Result<ReplyOrError<(<XCBConnection as RequestConnection>::Buf, Vec<OwnedFd>), <XCBConnection as RequestConnection>::Buf>, ConnectionError>

Wait for the reply to a request that has FDs. Read more
Source§

fn check_for_raw_error( &self, sequence: u64, ) -> Result<Option<<XCBConnection as RequestConnection>::Buf>, ConnectionError>

Check whether a request that does not have a reply caused an X11 error. Read more
Source§

fn maximum_request_bytes(&self) -> usize

The maximum number of bytes that the X11 server accepts in a request.
Source§

fn prefetch_maximum_request_bytes(&self)

Prefetches the maximum request length. Read more
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.
Source§

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

Send a request with a reply to the server. Read more
Source§

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

Send a request with a reply containing file descriptors to the server. Read more
Source§

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

Send a request without a reply to the server. Read more
Source§

fn wait_for_reply_or_error( &self, sequence: u64, ) -> Result<Self::Buf, ReplyError>

Wait for the reply to a request. Read more
Source§

fn wait_for_reply_with_fds( &self, sequence: u64, ) -> Result<(Self::Buf, Vec<OwnedFd>), ReplyError>

Wait for the reply to a request that has FDs. Read more
Source§

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

Check whether a request that does not have a reply caused an X11 error. Read more