BlockingDisplay

Struct BlockingDisplay 

Source
pub struct BlockingDisplay<T> { /* private fields */ }
Expand description

An AsyncDisplay that sends operations for the Display onto a blocking thread-pool.

Implementations§

Source§

impl<T> BlockingDisplay<T>

Source

pub fn new(display: T) -> BlockingDisplay<T>

Create a new BlockingDisplay.

Source

pub async fn into_inner(self) -> T

Get the inner display. This function will need to wait until it can cancel all of the ongoing wait or send request operations until it returns.

Source

pub async fn get_mut(&mut self) -> &mut T

Get a mutable reference to the inner display. This function will need to wait until it can cancel all of the ongoing wait or send request operations until it returns.

Trait Implementations§

Source§

impl<T: Display + Send + Sync + 'static> AsyncDisplay for BlockingDisplay<T>

Source§

fn poll_wait(&mut self, cx: &mut Context<'_>) -> Poll<Result>

Poll the current status of waiting for more input. There is no default implementation; the buffering strategy depends on the implementor. If this is called after a Poll::Ready is returned, it is assumed that the user wants to wait again. Read more
Source§

fn begin_send_request_raw( &mut self, req: RequestInfo, cx: &mut Context<'_>, ) -> PollOr<(), RequestInfo>

Begin sending a raw request to the server. In order to poll the status of this operation, use the poll_send_request_raw function. Read more
Source§

fn poll_send_request_raw(&mut self, cx: &mut Context<'_>) -> Poll<Result<u16>>

Poll an ongoing raw request operation. It should return Poll::Ready once the bytes passed in from begin_send_request_raw have been sent. Read more
Source§

impl<T: DisplayBase> DisplayBase for BlockingDisplay<T>

Source§

fn setup(&self) -> &StaticSetup

Get the Setup object that defines the X11 connection. Read more
Source§

fn default_screen_index(&self) -> usize

Get the default screen index. Read more
Source§

fn next_request_number(&mut self) -> u64

Generate the next request number to be used to define a request. Read more
Source§

fn generate_xid(&mut self) -> Option<XID>

Generate an XID within appropriate bounds. Returns None if our XIDs are exhausted. Read more
Source§

fn add_pending_item(&mut self, req_id: u16, item: PendingItem)

Add a PendingItem to this display’s map. Read more
Source§

fn get_pending_item(&mut self, req_id: u16) -> Option<PendingItem>

Clone a PendingItem from this display’s map and return it. See add_pending_item for more information.
Source§

fn take_pending_item(&mut self, req_id: u16) -> Option<PendingItem>

Remove a PendingItem from this display’s map. See add_pending_item for more information.
Source§

fn has_pending_event(&self) -> bool

Tell if there are any items currently in the queue.
Source§

fn push_event(&mut self, event: Event)

Push an event into this display’s event queue. Read more
Source§

fn pop_event(&mut self) -> Option<Event>

Pop an event from this display’s event queue. See push_event for more information.
Source§

fn create_special_event_queue(&mut self, xid: XID)

Create a new special event queue. Read more
Source§

fn push_special_event(&mut self, xid: XID, event: Event) -> Result<(), Event>

Push an event into the special event queue. See create_special_event_queue for more information.
Source§

fn pop_special_event(&mut self, xid: XID) -> Option<Event>

Pop an event from the special event queue. See create_special_event_queue for more information.
Source§

fn delete_special_event_queue(&mut self, xid: XID)

Delete a special event queue. See create_special_event_queue for more information.
Source§

fn checked(&self) -> bool

Whether or not zero-length replies are checked. Read more
Source§

fn set_checked(&mut self, checked: bool)

Set whether or not zero-length replies are checked. See checked for more information.
Source§

fn bigreq_enabled(&self) -> bool

Whether or not this display uses the bigreq extension, whereas requests consisting of over 262140 bytes are allowed to be sent over the connection.
Source§

fn max_request_len(&self) -> usize

The current maximum request length. This is the maximum number of bytes the server can handle at a time.
Source§

fn get_extension_opcode(&mut self, key: &[u8; 24]) -> Option<u8>

Get the opcode for an extension. Read more
Source§

fn set_extension_opcode(&mut self, key: [u8; 24], opcode: u8)

Set the opcode for an extension. See get_extension_opcode for more information.
Source§

fn wm_protocols_atom(&self) -> Option<NonZeroU32>

Get the WM_PROTOCOLS atom, which we cache in the display. Read more
Source§

fn set_wm_protocols_atom(&mut self, a: NonZeroU32)

Set the WM_PROTOCOLS atom. See wm_protocols_atom for more information.
Source§

fn add_pending_request(&mut self, req_id: u16, pereq: PendingRequest)

Insert a pending request into this display. This simply wraps the PendingRequest into a PendingItem and then calls add_pending_item.
Source§

fn get_pending_request(&mut self, req_id: u16) -> Option<PendingRequest>

Get a pending request from this display. This calls get_pending_item and returns None if the object is not a pending request.
Source§

fn take_pending_request(&mut self, req_id: u16) -> Option<PendingRequest>

Take a pending request from this display. This calls take_pending_item, inserting the object back into the map if it is not a request.
Source§

fn add_pending_reply(&mut self, req_id: u16, perep: PendingReply)

Insert a pending reply into this display. This simply wraps the PendingRequest into a PendingItem and then calls add_pending_item.
Source§

fn take_pending_reply(&mut self, req_id: u16) -> Option<PendingReply>

Take a pending reply from this display. This calls take_pending_item, inserting the object back into the map if it is not a reply.
Source§

fn add_pending_error(&mut self, req_id: u16, err: BreadError)

Insert a pending error into this display. This simply wraps the BreadError into a PendingItem and then calls add_pending_item.
Source§

fn check_for_pending_error(&mut self, req_id: u16) -> Result<(), BreadError>

Check this display for the pending error. This calls take_pending_item and returns Ok if the object if not an error.
Source§

fn screens(&self) -> &[Screen<'static, 'static>]

Get the list of screens in this display.
Source§

fn default_screen(&self) -> &Screen<'static, 'static>

Get the default screen in this display.
Source§

fn default_root(&self) -> Window

Get the default root for this display.
Source§

fn default_white_pixel(&self) -> u32

Get the default pixel used for the white color.
Source§

fn default_black_pixel(&self) -> u32

Get the default pixel used for the black color.
Source§

fn default_visual_id(&self) -> u32

Get the default visual ID for the screen.
Source§

fn default_visual(&self) -> &Visualtype

Get the default visual for the default screen.
Source§

fn default_colormap(&self) -> Colormap

Get the colormap for the default screen.
Source§

fn visual_id_to_visual(&self, id: u32) -> Option<&Visualtype>

Get a visual type from a visual ID.
Source§

fn get_scanline_pad(&self, depth: u8) -> usize

Get the scanline pad for a certain depth.
Source§

fn depth_of_visual(&self, id: u32) -> Option<u8>

Get the depth of the specified visual ID.

Auto Trait Implementations§

§

impl<T> Freeze for BlockingDisplay<T>
where T: Freeze,

§

impl<T> !RefUnwindSafe for BlockingDisplay<T>

§

impl<T> Send for BlockingDisplay<T>
where T: Send,

§

impl<T> Sync for BlockingDisplay<T>
where T: Sync,

§

impl<T> Unpin for BlockingDisplay<T>
where T: Unpin,

§

impl<T> !UnwindSafe for BlockingDisplay<T>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<D> AsyncDisplayDrawableExt for D
where D: AsyncDisplay + ?Sized,

Source§

fn get_drawable_geometry_async<Target>( &mut self, target: Target, ) -> SendRequestFuture<'_, Self, GetGeometryRequest>
where Target: Into<Drawable>,

Get the geometry of a drawable object, async redox.
Source§

fn get_drawable_geometry_immediate_async<Target>( &mut self, target: Target, ) -> MapFuture<ExchangeRequestFuture<'_, Self, GetGeometryRequest>, fn(Result<GetGeometryReply, BreadError>) -> Result<Geometry, BreadError>>
where Target: Into<Drawable>,

Immediately resolve the geometry of a drawable object, async redox.
Source§

fn copy_area_async<Source, Destination>( &mut self, source: Source, destination: Destination, gc: Gcontext, src_x: i16, src_y: i16, width: u16, height: u16, dest_x: i16, dest_y: i16, ) -> ExchangeRequestFuture<'_, Self, CopyAreaRequest>
where Source: Into<Drawable>, Destination: Into<Drawable>,

Copy pixels from one area of the drawable to another, async redox.
Source§

fn copy_plane_async<Source, Destination>( &mut self, source: Source, destination: Destination, gc: Gcontext, src_x: i16, src_y: i16, width: u16, height: u16, dest_x: i16, dest_y: i16, bit_plane: u32, ) -> ExchangeRequestFuture<'_, Self, CopyPlaneRequest>
where Source: Into<Drawable>, Destination: Into<Drawable>,

Copy a plane from one drawable to another, async redox.
Source§

fn create_pixmap_async<Target>( &mut self, target: Target, width: u16, height: u16, depth: u8, ) -> ExchangeXidFuture<'_, Self, CreatePixmapRequest, Pixmap, Box<dyn FnOnce(Pixmap) -> CreatePixmapRequest + Send>>
where Target: Into<Drawable>,

Create a new pixmap, async redox.
Source§

fn put_image_async<'a, Target, Data>( &'a mut self, target: Target, gc: Gcontext, image: &Image<Data>, src_x: isize, src_y: isize, dest_x: isize, dest_y: isize, width: usize, height: usize, ) -> PutImageFuture<'a, Self, Vec<PutImageRequest<'static>>>
where Target: Into<Drawable>, Data: Deref<Target = [u8]>,

Write an image to a drawable, async redox.
Source§

fn get_image_async<Target>( &mut self, target: Target, x: isize, y: isize, width: usize, height: usize, plane_mask: usize, format: ImageFormat, ) -> SendRequestFuture<'_, Self, GetImageRequest>
where Target: Into<Drawable>,

Get an image from a region in this drawable.
Source§

fn get_image_immediate_async<Target>( &mut self, target: Target, x: isize, y: isize, width: usize, height: usize, plane_mask: usize, format: ImageFormat, ) -> GetImageFuture<'_, Self>
where Target: Into<Drawable>,

Get an image from a region in this drawable, resolving immediately.
Source§

impl<D> AsyncDisplayExt for D
where D: AsyncDisplay + ?Sized,

Source§

fn wait_async(&mut self) -> WaitFuture<'_, D>

Wait until we recieve data. Read more
Source§

fn send_request_raw_async( &mut self, req: RequestInfo, ) -> SendRequestRawFuture<'_, D>

Send a raw request to the server. Read more
Source§

fn send_request_async<R>(&mut self, request: R) -> SendRequestFuture<'_, D, R>
where R: Request,

Send a request to the server. This is the async equivalent of the DisplayExt::send_request function. See that function for more information on what this is expected to do.
Source§

fn resolve_request_async<R>( &mut self, token: RequestCookie<R>, ) -> ResolveRequestFuture<'_, D, R>
where R: Request, <R as Request>::Reply: Default,

Resolve a request that we sent to the server. This is the async equivalent of the DisplayExt::resolve_request function. See that function for more information on what this is expected to do.
Source§

fn synchronize_async(&mut self) -> SynchronizeFuture<'_, D>

Synchronize this display so that every request that has been sent is resolved. This is the async equivalent of the Display::synchronize function. See that function for more information on what this is expected to do.
Source§

fn resolve_request_raw_async( &mut self, req_id: u16, ) -> WaitLoopFuture<'_, D, ResolveRequestRawHandler>

Resolve for a raw request. This is the async equivalent of the Display::resolve_request_raw function. See that function for more information on what this is expected to do.
Source§

fn wait_for_event_async(&mut self) -> WaitLoopFuture<'_, D, WaitForEventHandler>

Wait for an event to be sent from the X server. This is the async equivalent of the Display::wait_for_event function. See that function for more information on what this is expected to do.
Source§

fn wait_for_special_event_async( &mut self, xid: u32, ) -> WaitLoopFuture<'_, D, WaitForSpecialEventHandler>

Wait for a special event to be sent from the X server. This is the async equivalent of the Display::wait_for_special_event function. See that function for more information on what this is expected to do.
Source§

fn exchange_request_async<R>( &mut self, request: R, ) -> ExchangeRequestFuture<'_, D, R>
where R: Request,

Send a request and wait for a reply back. This is the async equivalent of the DisplayExt::exchange_request function. See that function for more information on what this is expected to do.
Source§

fn exchange_xid_async<R, U, F>( &mut self, to_request: F, ) -> ExchangeXidFuture<'_, D, R, U, F>
where R: Request, U: XidType + Unpin, F: FnOnce(U) -> R,

Send a no-op request to the server, but resolve for an XID. This is similar to exchange_request_async, but generates an XID before beginning the request send. This is largely a convenience wrapper.
Source§

impl<D> AsyncDisplayXprotoExt for D
where D: AsyncDisplay + ?Sized,

Source§

fn query_extension_async<'a, 'b, Name>( &'a mut self, name: Name, ) -> SendRequestFuture<'a, Self, QueryExtensionRequest<'b>>
where Name: Into<Cow<'b, str>>,

Query for extension information redox.
Source§

fn query_extension_immediate_async<'a, 'b, Name>( &'a mut self, name: Name, ) -> MapFuture<ExchangeRequestFuture<'a, Self, QueryExtensionRequest<'b>>, fn(Result<QueryExtensionReply, BreadError>) -> Result<Extension, BreadError>>
where Name: Into<Cow<'b, str>>,

Query for extension information, but resolve immediately redox . The Error::ExtensionNotPresent error is returned when the extension is not found.
Source§

fn create_window_async( &mut self, parent: Window, class: WindowClass, depth: Option<u8>, visual: Option<u32>, x: i16, y: i16, width: u16, height: u16, border_width: u16, props: WindowParameters, ) -> ExchangeXidFuture<'_, Self, CreateWindowRequest, Window, Box<dyn FnOnce(Window) -> CreateWindowRequest + Send>>

Create a new window redox.
Source§

fn create_simple_window_async( &mut self, parent: Window, x: i16, y: i16, width: u16, height: u16, border_width: u16, border: u32, background: u32, ) -> ExchangeXidFuture<'_, Self, CreateWindowRequest, Window, Box<dyn FnOnce(Window) -> CreateWindowRequest + Send>>

Create a window, but assume some parameters from its parents redox.
Source§

fn create_gc_async<Target>( &mut self, target: Target, props: GcParameters, ) -> ExchangeXidFuture<'_, Self, CreateGcRequest, Gcontext, Box<dyn FnOnce(Gcontext) -> CreateGcRequest + Send>>
where Target: Into<Drawable>,

Create a new graphics context redox.
Source§

fn intern_atom_async<'a, 'b, Name>( &'a mut self, name: Name, only_if_exists: bool, ) -> SendRequestFuture<'a, Self, InternAtomRequest<'b>>
where Name: Into<Cow<'b, str>>,

Intern a string and get a corresponding atom for that string redox.
Source§

fn intern_atom_immediate_async<'a, 'b, Name>( &'a mut self, name: Name, only_if_exists: bool, ) -> MapFuture<ExchangeRequestFuture<'a, Self, InternAtomRequest<'b>>, fn(Result<InternAtomReply, BreadError>) -> Result<Atom, BreadError>>
where Name: Into<Cow<'b, str>>,

Intern an atom, but try to resolve the request immediately redox.
Source§

fn change_keyboard_control_async( &mut self, props: KbParameters, ) -> ExchangeRequestFuture<'_, Self, ChangeKeyboardControlRequest>

Change the keyboard’s control properties redox.
Source§

fn bell_async( &mut self, percent: i8, ) -> ExchangeRequestFuture<'_, Self, BellRequest>

Source§

fn set_access_control_async( &mut self, mode: AccessControl, ) -> ExchangeRequestFuture<'_, Self, SetAccessControlRequest>

Source§

fn change_active_pointer_grab_async( &mut self, event_mask: EventMask, cursor: Cursor, time: Option<u32>, ) -> ExchangeRequestFuture<'_, Self, ChangeActivePointerGrabRequest>

Source§

fn set_close_down_mode_async( &mut self, mode: CloseDown, ) -> ExchangeRequestFuture<'_, Self, SetCloseDownModeRequest>

Source§

fn change_pointer_control_async( &mut self, accel_numerator: i16, accel_denominator: i16, threshold: i16, do_acceleration: bool, do_threshold: bool, ) -> ExchangeRequestFuture<'_, Self, ChangePointerControlRequest>

Source§

fn create_cursor_async( &mut self, source: Pixmap, mask: Pixmap, fg_red: u16, fg_green: u16, fg_blue: u16, bg_red: u16, bg_green: u16, bg_blue: u16, x: u16, y: u16, ) -> ExchangeXidFuture<'_, Self, CreateCursorRequest, Cursor, Box<dyn FnOnce(Cursor) -> CreateCursorRequest + Send>>

Create a new cursor redox.
Source§

fn force_screensaver_async( &mut self, mode: ScreenSaver, ) -> ExchangeRequestFuture<'_, Self, ForceScreenSaverRequest>

Source§

fn send_event_async( &mut self, target: Window, mask: EventMask, event: Event, ) -> ExchangeRequestFuture<'_, Self, SendEventRequest>

Send an event to the X server redox.
Source§

fn create_colormap_async( &mut self, window: Window, visual: u32, alloc: ColormapAlloc, ) -> ExchangeXidFuture<'_, Self, CreateColormapRequest, Colormap, Box<dyn FnOnce(Colormap) -> CreateColormapRequest + Send>>

Create a new colormap redox.
Source§

fn get_keyboard_mapping_async( &mut self, ) -> SendRequestFuture<'_, Self, GetKeyboardMappingRequest>

Get the keyboard mapping for this display redox.
Source§

fn get_keyboard_mapping_immediate_async( &mut self, ) -> ExchangeRequestFuture<'_, Self, GetKeyboardMappingRequest>

Immediately get the keyboard mapping for this display redox.
Source§

fn get_modifier_mapping_async( &mut self, ) -> SendRequestFuture<'_, Self, GetModifierMappingRequest>

Get the modifier mapping for this display redox.
Source§

fn get_modifier_mapping_immediate_async( &mut self, ) -> MapFuture<ExchangeRequestFuture<'_, Self, GetModifierMappingRequest>, fn(Result<GetModifierMappingReply<'_>, BreadError>) -> Result<ModifierMapping, BreadError>>

Immediately get the modifier mapping for this display.
Source§

fn grab_server_async( &mut self, ) -> ExchangeRequestFuture<'_, Self, GrabServerRequest>

Grab the server, async redox.
Source§

fn ungrab_server_async( &mut self, ) -> ExchangeRequestFuture<'_, Self, UngrabServerRequest>

Ungrab the server.
Source§

fn atom_name_async( &mut self, atom: Atom, ) -> SendRequestFuture<'_, Self, GetAtomNameRequest>

Get the name of an atom, async redox.
Source§

fn atom_name_immediate_async( &mut self, atom: Atom, ) -> MapFuture<ExchangeRequestFuture<'_, Self, GetAtomNameRequest>, fn(GetAtomNameReply<'_>) -> String>

Get the name of an atom, resolving immediately, async redox
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.