pub struct RustConnection<S = DefaultStream>where
    S: Stream,{ /* private fields */ }
Expand description

A connection to an X11 server implemented in pure rust

This type is generic over S, which allows to use a generic stream to communicate with the server. This stream can written to and read from, but it can also be polled, meaning that one checks if new data can be read or written.

RustConnection always used an internal buffer for reading, so R does not need to be buffered.

Implementations§

source§

impl RustConnection<DefaultStream>

source

pub fn connect( dpy_name: Option<&str> ) -> Result<(RustConnection<DefaultStream>, usize), ConnectError>

Establish a new connection.

If no dpy_name is provided, the value from $DISPLAY is used.

source§

impl<S> RustConnection<S>where S: Stream,

source

pub fn connect_to_stream( stream: S, screen: usize ) -> Result<RustConnection<S>, ConnectError>

Establish a new connection to the given streams.

read is used for reading data from the X11 server and write is used for writing. screen is the number of the screen that should be used. This function checks that a screen with that number exists.

source

pub fn connect_to_stream_with_auth_info( stream: S, screen: usize, auth_name: Vec<u8, Global>, auth_data: Vec<u8, Global> ) -> Result<RustConnection<S>, ConnectError>

Establish a new connection to the given streams.

read is used for reading data from the X11 server and write is used for writing. screen is the number of the screen that should be used. This function checks that a screen with that number exists.

The parameters auth_name and auth_data are used for the members authorization_protocol_name and authorization_protocol_data of the SetupRequest that is sent to the X11 server.

source

pub fn for_connected_stream( stream: S, setup: Setup ) -> Result<RustConnection<S>, ConnectError>

Establish a new connection for an already connected stream.

The given stream is used for communicating with the X11 server. It is assumed that setup was just received from the server. Thus, the first reply to a request that is sent will have sequence number one.

source

pub fn stream(&self) -> &S

Returns a reference to the contained stream.

Trait Implementations§

source§

impl<S> Connection for RustConnection<S>where S: Stream,

source§

fn wait_for_raw_event_with_sequence( &self ) -> Result<(Vec<u8, Global>, u64), ConnectionError>

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

fn poll_for_raw_event_with_sequence( &self ) -> Result<Option<(Vec<u8, Global>, 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 setup(&self) -> &Setup

Get the setup information sent by the X11 server. Read more
source§

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

Generate a new X11 identifier. 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<S> Debug for RustConnection<S>where S: Debug + Stream,

source§

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

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

impl<S> RequestConnection for RustConnection<S>where S: Stream,

§

type Buf = Vec<u8, Global>

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

fn send_request_with_reply<Reply>( &self, bufs: &[IoSlice<'_>], fds: Vec<RawFdContainer, Global> ) -> Result<Cookie<'_, RustConnection<S>, Reply>, ConnectionError>where Reply: TryParse,

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

fn send_request_with_reply_with_fds<Reply>( &self, bufs: &[IoSlice<'_>], fds: Vec<RawFdContainer, Global> ) -> Result<CookieWithFds<'_, RustConnection<S>, Reply>, ConnectionError>where Reply: 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<RawFdContainer, Global> ) -> Result<VoidCookie<'_, RustConnection<S>>, 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<Vec<u8, Global>, Vec<u8, Global>>, ConnectionError>

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

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

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

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

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

fn wait_for_reply_with_fds_raw( &self, sequence: u64 ) -> Result<ReplyOrError<(<RustConnection<DefaultStream> as RequestConnection>::Buf, Vec<RawFdContainer, Global>), <RustConnection<DefaultStream> as RequestConnection>::Buf>, ConnectionError>

Wait for the reply to a request that has FDs. 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<RawFdContainer, Global>), 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

Auto Trait Implementations§

§

impl<S> RefUnwindSafe for RustConnection<S>where S: RefUnwindSafe,

§

impl<S> Send for RustConnection<S>where S: Send,

§

impl<S> Sync for RustConnection<S>where S: Sync,

§

impl<S> Unpin for RustConnection<S>where S: Unpin,

§

impl<S> UnwindSafe for RustConnection<S>where S: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<C> ConnectionExt for Cwhere C: RequestConnection + ?Sized,

source§

fn shape_query_version( &self ) -> Result<Cookie<'_, Self, QueryVersionReply>, ConnectionError>

source§

fn shape_rectangles<'c, 'input>( &'c self, operation: SO, destination_kind: SK, ordering: ClipOrdering, destination_window: u32, x_offset: i16, y_offset: i16, rectangles: &'input [Rectangle] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn shape_mask<A>( &self, operation: SO, destination_kind: SK, destination_window: u32, x_offset: i16, y_offset: i16, source_bitmap: A ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>,

source§

fn shape_combine( &self, operation: SO, destination_kind: SK, source_kind: SK, destination_window: u32, x_offset: i16, y_offset: i16, source_window: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn shape_offset( &self, destination_kind: SK, destination_window: u32, x_offset: i16, y_offset: i16 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn shape_query_extents( &self, destination_window: u32 ) -> Result<Cookie<'_, Self, QueryExtentsReply>, ConnectionError>

source§

fn shape_select_input( &self, destination_window: u32, enable: bool ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn shape_input_selected( &self, destination_window: u32 ) -> Result<Cookie<'_, Self, InputSelectedReply>, ConnectionError>

source§

fn shape_get_rectangles( &self, window: u32, source_kind: SK ) -> Result<Cookie<'_, Self, GetRectanglesReply>, ConnectionError>

source§

impl<C> ConnectionExt for Cwhere C: ConnectionExt + ?Sized,

source§

fn change_property8<A, B>( &self, mode: PropMode, window: u32, property: A, type_: B, data: &[u8] ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>, B: Into<u32>,

Change a property on a window with format 8.
source§

fn change_property16<A, B>( &self, mode: PropMode, window: u32, property: A, type_: B, data: &[u16] ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>, B: Into<u32>,

Change a property on a window with format 16.
source§

fn change_property32<A, B>( &self, mode: PropMode, window: u32, property: A, type_: B, data: &[u32] ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>, B: Into<u32>,

Change a property on a window with format 32.
source§

fn sync(&self) -> Result<(), ReplyError>

Synchronise with the X11 server. Read more
source§

impl<C> ConnectionExt for Cwhere C: RequestConnection + ?Sized,

source§

fn xfixes_query_version( &self, client_major_version: u32, client_minor_version: u32 ) -> Result<Cookie<'_, Self, QueryVersionReply>, ConnectionError>

source§

fn xfixes_change_save_set( &self, mode: SaveSetMode, target: SaveSetTarget, map: SaveSetMapping, window: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn xfixes_select_selection_input<A>( &self, window: u32, selection: u32, event_mask: A ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>,

source§

fn xfixes_select_cursor_input<A>( &self, window: u32, event_mask: A ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>,

source§

fn xfixes_get_cursor_image( &self ) -> Result<Cookie<'_, Self, GetCursorImageReply>, ConnectionError>

source§

fn xfixes_create_region<'c, 'input>( &'c self, region: u32, rectangles: &'input [Rectangle] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn xfixes_create_region_from_bitmap( &self, region: u32, bitmap: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn xfixes_create_region_from_window( &self, region: u32, window: u32, kind: SK ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn xfixes_create_region_from_gc( &self, region: u32, gc: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn xfixes_create_region_from_picture( &self, region: u32, picture: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn xfixes_destroy_region( &self, region: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn xfixes_set_region<'c, 'input>( &'c self, region: u32, rectangles: &'input [Rectangle] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn xfixes_copy_region( &self, source: u32, destination: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn xfixes_union_region( &self, source1: u32, source2: u32, destination: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn xfixes_intersect_region( &self, source1: u32, source2: u32, destination: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn xfixes_subtract_region( &self, source1: u32, source2: u32, destination: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn xfixes_invert_region( &self, source: u32, bounds: Rectangle, destination: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn xfixes_translate_region( &self, region: u32, dx: i16, dy: i16 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn xfixes_region_extents( &self, source: u32, destination: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn xfixes_fetch_region( &self, region: u32 ) -> Result<Cookie<'_, Self, FetchRegionReply>, ConnectionError>

source§

fn xfixes_set_gc_clip_region<A>( &self, gc: u32, region: A, x_origin: i16, y_origin: i16 ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>,

source§

fn xfixes_set_window_shape_region<A>( &self, dest: u32, dest_kind: SK, x_offset: i16, y_offset: i16, region: A ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>,

source§

fn xfixes_set_picture_clip_region<A>( &self, picture: u32, region: A, x_origin: i16, y_origin: i16 ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>,

source§

fn xfixes_set_cursor_name<'c, 'input>( &'c self, cursor: u32, name: &'input [u8] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn xfixes_get_cursor_name( &self, cursor: u32 ) -> Result<Cookie<'_, Self, GetCursorNameReply>, ConnectionError>

source§

fn xfixes_get_cursor_image_and_name( &self ) -> Result<Cookie<'_, Self, GetCursorImageAndNameReply>, ConnectionError>

source§

fn xfixes_change_cursor( &self, source: u32, destination: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn xfixes_change_cursor_by_name<'c, 'input>( &'c self, src: u32, name: &'input [u8] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn xfixes_expand_region( &self, source: u32, destination: u32, left: u16, right: u16, top: u16, bottom: u16 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn xfixes_hide_cursor( &self, window: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn xfixes_show_cursor( &self, window: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn xfixes_create_pointer_barrier<A, 'c, 'input>( &'c self, barrier: u32, window: u32, x1: u16, y1: u16, x2: u16, y2: u16, directions: A, devices: &'input [u16] ) -> Result<VoidCookie<'c, Self>, ConnectionError>where A: Into<u32>,

source§

fn xfixes_delete_pointer_barrier( &self, barrier: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

impl<C> ConnectionExt for Cwhere C: RequestConnection + ?Sized,

source§

fn render_query_version( &self, client_major_version: u32, client_minor_version: u32 ) -> Result<Cookie<'_, Self, QueryVersionReply>, ConnectionError>

source§

fn render_query_pict_formats( &self ) -> Result<Cookie<'_, Self, QueryPictFormatsReply>, ConnectionError>

source§

fn render_query_pict_index_values( &self, format: u32 ) -> Result<Cookie<'_, Self, QueryPictIndexValuesReply>, ConnectionError>

source§

fn render_create_picture<'c, 'input>( &'c self, pid: u32, drawable: u32, format: u32, value_list: &'input CreatePictureAux ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn render_change_picture<'c, 'input>( &'c self, picture: u32, value_list: &'input ChangePictureAux ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn render_set_picture_clip_rectangles<'c, 'input>( &'c self, picture: u32, clip_x_origin: i16, clip_y_origin: i16, rectangles: &'input [Rectangle] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn render_free_picture( &self, picture: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn render_composite<A>( &self, op: PictOp, src: u32, mask: A, dst: u32, src_x: i16, src_y: i16, mask_x: i16, mask_y: i16, dst_x: i16, dst_y: i16, width: u16, height: u16 ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>,

source§

fn render_trapezoids<'c, 'input>( &'c self, op: PictOp, src: u32, dst: u32, mask_format: u32, src_x: i16, src_y: i16, traps: &'input [Trapezoid] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn render_triangles<'c, 'input>( &'c self, op: PictOp, src: u32, dst: u32, mask_format: u32, src_x: i16, src_y: i16, triangles: &'input [Triangle] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn render_tri_strip<'c, 'input>( &'c self, op: PictOp, src: u32, dst: u32, mask_format: u32, src_x: i16, src_y: i16, points: &'input [Pointfix] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn render_tri_fan<'c, 'input>( &'c self, op: PictOp, src: u32, dst: u32, mask_format: u32, src_x: i16, src_y: i16, points: &'input [Pointfix] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn render_create_glyph_set( &self, gsid: u32, format: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn render_reference_glyph_set( &self, gsid: u32, existing: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn render_free_glyph_set( &self, glyphset: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn render_add_glyphs<'c, 'input>( &'c self, glyphset: u32, glyphids: &'input [u32], glyphs: &'input [Glyphinfo], data: &'input [u8] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn render_free_glyphs<'c, 'input>( &'c self, glyphset: u32, glyphs: &'input [u32] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn render_composite_glyphs8<'c, 'input>( &'c self, op: PictOp, src: u32, dst: u32, mask_format: u32, glyphset: u32, src_x: i16, src_y: i16, glyphcmds: &'input [u8] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn render_composite_glyphs16<'c, 'input>( &'c self, op: PictOp, src: u32, dst: u32, mask_format: u32, glyphset: u32, src_x: i16, src_y: i16, glyphcmds: &'input [u8] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn render_composite_glyphs32<'c, 'input>( &'c self, op: PictOp, src: u32, dst: u32, mask_format: u32, glyphset: u32, src_x: i16, src_y: i16, glyphcmds: &'input [u8] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn render_fill_rectangles<'c, 'input>( &'c self, op: PictOp, dst: u32, color: Color, rects: &'input [Rectangle] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn render_create_cursor( &self, cid: u32, source: u32, x: u16, y: u16 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn render_set_picture_transform( &self, picture: u32, transform: Transform ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn render_query_filters( &self, drawable: u32 ) -> Result<Cookie<'_, Self, QueryFiltersReply>, ConnectionError>

source§

fn render_set_picture_filter<'c, 'input>( &'c self, picture: u32, filter: &'input [u8], values: &'input [i32] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn render_create_anim_cursor<'c, 'input>( &'c self, cid: u32, cursors: &'input [Animcursorelt] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn render_add_traps<'c, 'input>( &'c self, picture: u32, x_off: i16, y_off: i16, traps: &'input [Trap] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn render_create_solid_fill( &self, picture: u32, color: Color ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn render_create_linear_gradient<'c, 'input>( &'c self, picture: u32, p1: Pointfix, p2: Pointfix, stops: &'input [i32], colors: &'input [Color] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn render_create_radial_gradient<'c, 'input>( &'c self, picture: u32, inner: Pointfix, outer: Pointfix, inner_radius: i32, outer_radius: i32, stops: &'input [i32], colors: &'input [Color] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn render_create_conical_gradient<'c, 'input>( &'c self, picture: u32, center: Pointfix, angle: i32, stops: &'input [i32], colors: &'input [Color] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

impl<C> ConnectionExt for Cwhere C: RequestConnection + ?Sized,

source§

fn bigreq_enable( &self ) -> Result<Cookie<'_, Self, EnableReply>, ConnectionError>

source§

impl<C> ConnectionExt for Cwhere C: RequestConnection + ?Sized,

source§

fn ge_query_version( &self, client_major_version: u16, client_minor_version: u16 ) -> Result<Cookie<'_, Self, QueryVersionReply>, ConnectionError>

source§

impl<C> ConnectionExt for Cwhere C: RequestConnection + ?Sized,

source§

fn xc_misc_get_version( &self, client_major_version: u16, client_minor_version: u16 ) -> Result<Cookie<'_, Self, GetVersionReply>, ConnectionError>

source§

fn xc_misc_get_xid_range( &self ) -> Result<Cookie<'_, Self, GetXIDRangeReply>, ConnectionError>

source§

fn xc_misc_get_xid_list( &self, count: u32 ) -> Result<Cookie<'_, Self, GetXIDListReply>, ConnectionError>

source§

impl<C> ConnectionExt for Cwhere C: RequestConnection + ?Sized,

source§

fn create_window<'c, 'input>( &'c self, depth: u8, wid: u32, parent: u32, x: i16, y: i16, width: u16, height: u16, border_width: u16, class: WindowClass, visual: u32, value_list: &'input CreateWindowAux ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Creates a window. Read more
source§

fn change_window_attributes<'c, 'input>( &'c self, window: u32, value_list: &'input ChangeWindowAttributesAux ) -> Result<VoidCookie<'c, Self>, ConnectionError>

change window attributes. Read more
source§

fn get_window_attributes( &self, window: u32 ) -> Result<Cookie<'_, Self, GetWindowAttributesReply>, ConnectionError>

Gets window attributes. Read more
source§

fn destroy_window( &self, window: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Destroys a window. Read more
source§

fn destroy_subwindows( &self, window: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn change_save_set( &self, mode: SetMode, window: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Changes a client’s save set. Read more
source§

fn reparent_window( &self, window: u32, parent: u32, x: i16, y: i16 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Reparents a window. Read more
source§

fn map_window( &self, window: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Makes a window visible. Read more
source§

fn map_subwindows( &self, window: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn unmap_window( &self, window: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Makes a window invisible. Read more
source§

fn unmap_subwindows( &self, window: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn configure_window<'c, 'input>( &'c self, window: u32, value_list: &'input ConfigureWindowAux ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Configures window attributes. Read more
source§

fn circulate_window( &self, direction: Circulate, window: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Change window stacking order. Read more
source§

fn get_geometry( &self, drawable: u32 ) -> Result<Cookie<'_, Self, GetGeometryReply>, ConnectionError>

Get current window geometry. Read more
source§

fn query_tree( &self, window: u32 ) -> Result<Cookie<'_, Self, QueryTreeReply>, ConnectionError>

query the window tree. Read more
source§

fn intern_atom<'c, 'input>( &'c self, only_if_exists: bool, name: &'input [u8] ) -> Result<Cookie<'c, Self, InternAtomReply>, ConnectionError>

Get atom identifier by name. Read more
source§

fn get_atom_name( &self, atom: u32 ) -> Result<Cookie<'_, Self, GetAtomNameReply>, ConnectionError>

source§

fn change_property<A, B, 'c, 'input>( &'c self, mode: PropMode, window: u32, property: A, type_: B, format: u8, data_len: u32, data: &'input [u8] ) -> Result<VoidCookie<'c, Self>, ConnectionError>where A: Into<u32>, B: Into<u32>,

Changes a window property. Read more
source§

fn delete_property( &self, window: u32, property: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn get_property<A, B>( &self, delete: bool, window: u32, property: A, type_: B, long_offset: u32, long_length: u32 ) -> Result<Cookie<'_, Self, GetPropertyReply>, ConnectionError>where A: Into<u32>, B: Into<u32>,

Gets a window property. Read more
source§

fn list_properties( &self, window: u32 ) -> Result<Cookie<'_, Self, ListPropertiesReply>, ConnectionError>

source§

fn set_selection_owner<A, B>( &self, owner: A, selection: u32, time: B ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>, B: Into<u32>,

Sets the owner of a selection. Read more
source§

fn get_selection_owner( &self, selection: u32 ) -> Result<Cookie<'_, Self, GetSelectionOwnerReply>, ConnectionError>

Gets the owner of a selection. Read more
source§

fn convert_selection<A, B>( &self, requestor: u32, selection: u32, target: u32, property: A, time: B ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>, B: Into<u32>,

source§

fn send_event<A, B, C>( &self, propagate: bool, destination: A, event_mask: B, event: C ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>, B: Into<u32>, C: Into<[u8; 32]>,

send an event. Read more
source§

fn grab_pointer<A, B, C, D>( &self, owner_events: bool, grab_window: u32, event_mask: A, pointer_mode: GrabMode, keyboard_mode: GrabMode, confine_to: B, cursor: C, time: D ) -> Result<Cookie<'_, Self, GrabPointerReply>, ConnectionError>where A: Into<u16>, B: Into<u32>, C: Into<u32>, D: Into<u32>,

Grab the pointer. Read more
source§

fn ungrab_pointer<A>( &self, time: A ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>,

release the pointer. Read more
source§

fn grab_button<A, B, C, D>( &self, owner_events: bool, grab_window: u32, event_mask: A, pointer_mode: GrabMode, keyboard_mode: GrabMode, confine_to: B, cursor: C, button: ButtonIndex, modifiers: D ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u16>, B: Into<u32>, C: Into<u32>, D: Into<u16>,

Grab pointer button(s). Read more
source§

fn ungrab_button<A>( &self, button: ButtonIndex, grab_window: u32, modifiers: A ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u16>,

source§

fn change_active_pointer_grab<A, B, C>( &self, cursor: A, time: B, event_mask: C ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>, B: Into<u32>, C: Into<u16>,

source§

fn grab_keyboard<A>( &self, owner_events: bool, grab_window: u32, time: A, pointer_mode: GrabMode, keyboard_mode: GrabMode ) -> Result<Cookie<'_, Self, GrabKeyboardReply>, ConnectionError>where A: Into<u32>,

Grab the keyboard. Read more
source§

fn ungrab_keyboard<A>( &self, time: A ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>,

source§

fn grab_key<A, B>( &self, owner_events: bool, grab_window: u32, modifiers: A, key: B, pointer_mode: GrabMode, keyboard_mode: GrabMode ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u16>, B: Into<u8>,

Grab keyboard key(s). Read more
source§

fn ungrab_key<A, B>( &self, key: A, grab_window: u32, modifiers: B ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u8>, B: Into<u16>,

release a key combination. Read more
source§

fn allow_events<A>( &self, mode: Allow, time: A ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>,

release queued events. Read more
source§

fn grab_server(&self) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn ungrab_server(&self) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn query_pointer( &self, window: u32 ) -> Result<Cookie<'_, Self, QueryPointerReply>, ConnectionError>

get pointer coordinates. Read more
source§

fn get_motion_events<A, B>( &self, window: u32, start: A, stop: B ) -> Result<Cookie<'_, Self, GetMotionEventsReply>, ConnectionError>where A: Into<u32>, B: Into<u32>,

source§

fn translate_coordinates( &self, src_window: u32, dst_window: u32, src_x: i16, src_y: i16 ) -> Result<Cookie<'_, Self, TranslateCoordinatesReply>, ConnectionError>

source§

fn warp_pointer<A, B>( &self, src_window: A, dst_window: B, src_x: i16, src_y: i16, src_width: u16, src_height: u16, dst_x: i16, dst_y: i16 ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>, B: Into<u32>,

move mouse pointer. Read more
source§

fn set_input_focus<A, B>( &self, revert_to: InputFocus, focus: A, time: B ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>, B: Into<u32>,

Sets input focus. Read more
source§

fn get_input_focus( &self ) -> Result<Cookie<'_, Self, GetInputFocusReply>, ConnectionError>

source§

fn query_keymap( &self ) -> Result<Cookie<'_, Self, QueryKeymapReply>, ConnectionError>

source§

fn open_font<'c, 'input>( &'c self, fid: u32, name: &'input [u8] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

opens a font. Read more
source§

fn close_font(&self, font: u32) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn query_font( &self, font: u32 ) -> Result<Cookie<'_, Self, QueryFontReply>, ConnectionError>

query font metrics. Read more
source§

fn query_text_extents<'c, 'input>( &'c self, font: u32, string: &'input [Char2b] ) -> Result<Cookie<'c, Self, QueryTextExtentsReply>, ConnectionError>

get text extents. Read more
source§

fn list_fonts<'c, 'input>( &'c self, max_names: u16, pattern: &'input [u8] ) -> Result<Cookie<'c, Self, ListFontsReply>, ConnectionError>

get matching font names. Read more
source§

fn list_fonts_with_info<'c, 'input>( &'c self, max_names: u16, pattern: &'input [u8] ) -> Result<ListFontsWithInfoCookie<'c, Self>, ConnectionError>

get matching font names and information. Read more
source§

fn set_font_path<'c, 'input>( &'c self, font: &'input [Str] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn get_font_path( &self ) -> Result<Cookie<'_, Self, GetFontPathReply>, ConnectionError>

source§

fn create_pixmap( &self, depth: u8, pid: u32, drawable: u32, width: u16, height: u16 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Creates a pixmap. Read more
source§

fn free_pixmap( &self, pixmap: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Destroys a pixmap. Read more
source§

fn create_gc<'c, 'input>( &'c self, cid: u32, drawable: u32, value_list: &'input CreateGCAux ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Creates a graphics context. Read more
source§

fn change_gc<'c, 'input>( &'c self, gc: u32, value_list: &'input ChangeGCAux ) -> Result<VoidCookie<'c, Self>, ConnectionError>

change graphics context components. Read more
source§

fn copy_gc<A>( &self, src_gc: u32, dst_gc: u32, value_mask: A ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>,

source§

fn set_dashes<'c, 'input>( &'c self, gc: u32, dash_offset: u16, dashes: &'input [u8] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn set_clip_rectangles<'c, 'input>( &'c self, ordering: ClipOrdering, gc: u32, clip_x_origin: i16, clip_y_origin: i16, rectangles: &'input [Rectangle] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn free_gc(&self, gc: u32) -> Result<VoidCookie<'_, Self>, ConnectionError>

Destroys a graphics context. Read more
source§

fn clear_area( &self, exposures: bool, window: u32, x: i16, y: i16, width: u16, height: u16 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn copy_area( &self, src_drawable: u32, dst_drawable: u32, gc: u32, src_x: i16, src_y: i16, dst_x: i16, dst_y: i16, width: u16, height: u16 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

copy areas. Read more
source§

fn copy_plane( &self, src_drawable: u32, dst_drawable: u32, gc: u32, src_x: i16, src_y: i16, dst_x: i16, dst_y: i16, width: u16, height: u16, bit_plane: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn poly_point<'c, 'input>( &'c self, coordinate_mode: CoordMode, drawable: u32, gc: u32, points: &'input [Point] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn poly_line<'c, 'input>( &'c self, coordinate_mode: CoordMode, drawable: u32, gc: u32, points: &'input [Point] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

draw lines. Read more
source§

fn poly_segment<'c, 'input>( &'c self, drawable: u32, gc: u32, segments: &'input [Segment] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

draw lines. Read more
source§

fn poly_rectangle<'c, 'input>( &'c self, drawable: u32, gc: u32, rectangles: &'input [Rectangle] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn poly_arc<'c, 'input>( &'c self, drawable: u32, gc: u32, arcs: &'input [Arc] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn fill_poly<'c, 'input>( &'c self, drawable: u32, gc: u32, shape: PolyShape, coordinate_mode: CoordMode, points: &'input [Point] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn poly_fill_rectangle<'c, 'input>( &'c self, drawable: u32, gc: u32, rectangles: &'input [Rectangle] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Fills rectangles. Read more
source§

fn poly_fill_arc<'c, 'input>( &'c self, drawable: u32, gc: u32, arcs: &'input [Arc] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn put_image<'c, 'input>( &'c self, format: ImageFormat, drawable: u32, gc: u32, width: u16, height: u16, dst_x: i16, dst_y: i16, left_pad: u8, depth: u8, data: &'input [u8] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn get_image( &self, format: ImageFormat, drawable: u32, x: i16, y: i16, width: u16, height: u16, plane_mask: u32 ) -> Result<Cookie<'_, Self, GetImageReply>, ConnectionError>

source§

fn poly_text8<'c, 'input>( &'c self, drawable: u32, gc: u32, x: i16, y: i16, items: &'input [u8] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn poly_text16<'c, 'input>( &'c self, drawable: u32, gc: u32, x: i16, y: i16, items: &'input [u8] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn image_text8<'c, 'input>( &'c self, drawable: u32, gc: u32, x: i16, y: i16, string: &'input [u8] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Draws text. Read more
source§

fn image_text16<'c, 'input>( &'c self, drawable: u32, gc: u32, x: i16, y: i16, string: &'input [Char2b] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Draws text. Read more
source§

fn create_colormap( &self, alloc: ColormapAlloc, mid: u32, window: u32, visual: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn free_colormap( &self, cmap: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn copy_colormap_and_free( &self, mid: u32, src_cmap: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn install_colormap( &self, cmap: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn uninstall_colormap( &self, cmap: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn list_installed_colormaps( &self, window: u32 ) -> Result<Cookie<'_, Self, ListInstalledColormapsReply>, ConnectionError>

source§

fn alloc_color( &self, cmap: u32, red: u16, green: u16, blue: u16 ) -> Result<Cookie<'_, Self, AllocColorReply>, ConnectionError>

Allocate a color. Read more
source§

fn alloc_named_color<'c, 'input>( &'c self, cmap: u32, name: &'input [u8] ) -> Result<Cookie<'c, Self, AllocNamedColorReply>, ConnectionError>

source§

fn alloc_color_cells( &self, contiguous: bool, cmap: u32, colors: u16, planes: u16 ) -> Result<Cookie<'_, Self, AllocColorCellsReply>, ConnectionError>

source§

fn alloc_color_planes( &self, contiguous: bool, cmap: u32, colors: u16, reds: u16, greens: u16, blues: u16 ) -> Result<Cookie<'_, Self, AllocColorPlanesReply>, ConnectionError>

source§

fn free_colors<'c, 'input>( &'c self, cmap: u32, plane_mask: u32, pixels: &'input [u32] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn store_colors<'c, 'input>( &'c self, cmap: u32, items: &'input [Coloritem] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn store_named_color<A, 'c, 'input>( &'c self, flags: A, cmap: u32, pixel: u32, name: &'input [u8] ) -> Result<VoidCookie<'c, Self>, ConnectionError>where A: Into<u8>,

source§

fn query_colors<'c, 'input>( &'c self, cmap: u32, pixels: &'input [u32] ) -> Result<Cookie<'c, Self, QueryColorsReply>, ConnectionError>

source§

fn lookup_color<'c, 'input>( &'c self, cmap: u32, name: &'input [u8] ) -> Result<Cookie<'c, Self, LookupColorReply>, ConnectionError>

source§

fn create_cursor<A>( &self, cid: u32, source: u32, mask: A, fore_red: u16, fore_green: u16, fore_blue: u16, back_red: u16, back_green: u16, back_blue: u16, x: u16, y: u16 ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>,

source§

fn create_glyph_cursor<A>( &self, cid: u32, source_font: u32, mask_font: A, source_char: u16, mask_char: u16, fore_red: u16, fore_green: u16, fore_blue: u16, back_red: u16, back_green: u16, back_blue: u16 ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>,

create cursor. Read more
source§

fn free_cursor( &self, cursor: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Deletes a cursor. Read more
source§

fn recolor_cursor( &self, cursor: u32, fore_red: u16, fore_green: u16, fore_blue: u16, back_red: u16, back_green: u16, back_blue: u16 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn query_best_size( &self, class: QueryShapeOf, drawable: u32, width: u16, height: u16 ) -> Result<Cookie<'_, Self, QueryBestSizeReply>, ConnectionError>

source§

fn query_extension<'c, 'input>( &'c self, name: &'input [u8] ) -> Result<Cookie<'c, Self, QueryExtensionReply>, ConnectionError>

check if extension is present. Read more
source§

fn list_extensions( &self ) -> Result<Cookie<'_, Self, ListExtensionsReply>, ConnectionError>

source§

fn change_keyboard_mapping<'c, 'input>( &'c self, keycode_count: u8, first_keycode: u8, keysyms_per_keycode: u8, keysyms: &'input [u32] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn get_keyboard_mapping( &self, first_keycode: u8, count: u8 ) -> Result<Cookie<'_, Self, GetKeyboardMappingReply>, ConnectionError>

source§

fn change_keyboard_control<'c, 'input>( &'c self, value_list: &'input ChangeKeyboardControlAux ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn get_keyboard_control( &self ) -> Result<Cookie<'_, Self, GetKeyboardControlReply>, ConnectionError>

source§

fn bell(&self, percent: i8) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn change_pointer_control( &self, acceleration_numerator: i16, acceleration_denominator: i16, threshold: i16, do_acceleration: bool, do_threshold: bool ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn get_pointer_control( &self ) -> Result<Cookie<'_, Self, GetPointerControlReply>, ConnectionError>

source§

fn set_screen_saver( &self, timeout: i16, interval: i16, prefer_blanking: Blanking, allow_exposures: Exposures ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn get_screen_saver( &self ) -> Result<Cookie<'_, Self, GetScreenSaverReply>, ConnectionError>

source§

fn change_hosts<'c, 'input>( &'c self, mode: HostMode, family: Family, address: &'input [u8] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn list_hosts( &self ) -> Result<Cookie<'_, Self, ListHostsReply>, ConnectionError>

source§

fn set_access_control( &self, mode: AccessControl ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn set_close_down_mode( &self, mode: CloseDown ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn kill_client<A>( &self, resource: A ) -> Result<VoidCookie<'_, Self>, ConnectionError>where A: Into<u32>,

kills a client. Read more
source§

fn rotate_properties<'c, 'input>( &'c self, window: u32, delta: i16, atoms: &'input [u32] ) -> Result<VoidCookie<'c, Self>, ConnectionError>

source§

fn force_screen_saver( &self, mode: ScreenSaver ) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

fn set_pointer_mapping<'c, 'input>( &'c self, map: &'input [u8] ) -> Result<Cookie<'c, Self, SetPointerMappingReply>, ConnectionError>

source§

fn get_pointer_mapping( &self ) -> Result<Cookie<'_, Self, GetPointerMappingReply>, ConnectionError>

source§

fn set_modifier_mapping<'c, 'input>( &'c self, keycodes: &'input [u8] ) -> Result<Cookie<'c, Self, SetModifierMappingReply>, ConnectionError>

source§

fn get_modifier_mapping( &self ) -> Result<Cookie<'_, Self, GetModifierMappingReply>, ConnectionError>

source§

fn no_operation(&self) -> Result<VoidCookie<'_, Self>, ConnectionError>

source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.