WlDisplay

Struct WlDisplay 

Source
pub struct WlDisplay { /* private fields */ }
Expand description

A wl_display object.

See the documentation of the module for the interface description.

Implementations§

Source§

impl WlDisplay

Source

pub fn set_handler(&self, handler: impl WlDisplayHandler)

Sets a new handler.

Source

pub fn set_boxed_handler(&self, handler: Box<dyn WlDisplayHandler>)

Sets a new, already boxed handler.

Source§

impl WlDisplay

Source

pub const MSG__SYNC__SINCE: u32 = 1u32

Since when the sync message is available.

Source

pub const MSG__GET_REGISTRY__SINCE: u32 = 1u32

Since when the get_registry message is available.

Source

pub const MSG__ERROR__SINCE: u32 = 1u32

Since when the error message is available.

Source

pub const MSG__DELETE_ID__SINCE: u32 = 1u32

Since when the delete_id message is available.

Source

pub fn try_send_sync( &self, callback: &Rc<WlCallback>, ) -> Result<(), ObjectError>

asynchronous roundtrip

The sync request asks the server to emit the ‘done’ event on the returned wl_callback object. Since requests are handled in-order and events are delivered in-order, this can be used as a barrier to ensure all previous requests and the resulting events have been handled.

The object returned by this request will be destroyed by the compositor after the callback is fired and as such the client must not attempt to use it after that point.

The callback_data passed in the callback is undefined and should be ignored.

§Arguments
  • callback: callback object for the sync request
Source

pub fn send_sync(&self, callback: &Rc<WlCallback>)

asynchronous roundtrip

The sync request asks the server to emit the ‘done’ event on the returned wl_callback object. Since requests are handled in-order and events are delivered in-order, this can be used as a barrier to ensure all previous requests and the resulting events have been handled.

The object returned by this request will be destroyed by the compositor after the callback is fired and as such the client must not attempt to use it after that point.

The callback_data passed in the callback is undefined and should be ignored.

§Arguments
  • callback: callback object for the sync request
Source

pub fn new_try_send_sync(&self) -> Result<Rc<WlCallback>, ObjectError>

asynchronous roundtrip

The sync request asks the server to emit the ‘done’ event on the returned wl_callback object. Since requests are handled in-order and events are delivered in-order, this can be used as a barrier to ensure all previous requests and the resulting events have been handled.

The object returned by this request will be destroyed by the compositor after the callback is fired and as such the client must not attempt to use it after that point.

The callback_data passed in the callback is undefined and should be ignored.

Source

pub fn new_send_sync(&self) -> Rc<WlCallback>

asynchronous roundtrip

The sync request asks the server to emit the ‘done’ event on the returned wl_callback object. Since requests are handled in-order and events are delivered in-order, this can be used as a barrier to ensure all previous requests and the resulting events have been handled.

The object returned by this request will be destroyed by the compositor after the callback is fired and as such the client must not attempt to use it after that point.

The callback_data passed in the callback is undefined and should be ignored.

Source

pub fn try_send_get_registry( &self, registry: &Rc<WlRegistry>, ) -> Result<(), ObjectError>

get global registry object

This request creates a registry object that allows the client to list and bind the global objects available from the compositor.

It should be noted that the server side resources consumed in response to a get_registry request can only be released when the client disconnects, not when the client side proxy is destroyed. Therefore, clients should invoke get_registry as infrequently as possible to avoid wasting memory.

§Arguments
  • registry: global registry object
Source

pub fn send_get_registry(&self, registry: &Rc<WlRegistry>)

get global registry object

This request creates a registry object that allows the client to list and bind the global objects available from the compositor.

It should be noted that the server side resources consumed in response to a get_registry request can only be released when the client disconnects, not when the client side proxy is destroyed. Therefore, clients should invoke get_registry as infrequently as possible to avoid wasting memory.

§Arguments
  • registry: global registry object
Source

pub fn new_try_send_get_registry(&self) -> Result<Rc<WlRegistry>, ObjectError>

get global registry object

This request creates a registry object that allows the client to list and bind the global objects available from the compositor.

It should be noted that the server side resources consumed in response to a get_registry request can only be released when the client disconnects, not when the client side proxy is destroyed. Therefore, clients should invoke get_registry as infrequently as possible to avoid wasting memory.

Source

pub fn new_send_get_registry(&self) -> Rc<WlRegistry>

get global registry object

This request creates a registry object that allows the client to list and bind the global objects available from the compositor.

It should be noted that the server side resources consumed in response to a get_registry request can only be released when the client disconnects, not when the client side proxy is destroyed. Therefore, clients should invoke get_registry as infrequently as possible to avoid wasting memory.

Source

pub fn try_send_error( &self, object_id: Rc<dyn Object>, code: u32, message: &str, ) -> Result<(), ObjectError>

fatal error event

The error event is sent out when a fatal (non-recoverable) error has occurred. The object_id argument is the object where the error occurred, most often in response to a request to that object. The code identifies the error and is defined by the object interface. As such, each interface defines its own set of error codes. The message is a brief description of the error, for (debugging) convenience.

§Arguments
  • object_id: object where the error occurred
  • code: error code
  • message: error description
Source

pub fn send_error(&self, object_id: Rc<dyn Object>, code: u32, message: &str)

fatal error event

The error event is sent out when a fatal (non-recoverable) error has occurred. The object_id argument is the object where the error occurred, most often in response to a request to that object. The code identifies the error and is defined by the object interface. As such, each interface defines its own set of error codes. The message is a brief description of the error, for (debugging) convenience.

§Arguments
  • object_id: object where the error occurred
  • code: error code
  • message: error description
Source

pub fn try_send_delete_id(&self, id: u32) -> Result<(), ObjectError>

acknowledge object ID deletion

This event is used internally by the object ID management logic. When a client deletes an object that it had created, the server will send this event to acknowledge that it has seen the delete request. When the client receives this event, it will know that it can safely reuse the object ID.

§Arguments
  • id: deleted object ID
Source

pub fn send_delete_id(&self, id: u32)

acknowledge object ID deletion

This event is used internally by the object ID management logic. When a client deletes an object that it had created, the server will send this event to acknowledge that it has seen the delete request. When the client receives this event, it will know that it can safely reuse the object ID.

§Arguments
  • id: deleted object ID
Source§

impl WlDisplay

Source

pub const ENM__ERROR_INVALID_OBJECT__SINCE: u32 = 1u32

Since when the error.invalid_object enum variant is available.

Source

pub const ENM__ERROR_INVALID_METHOD__SINCE: u32 = 1u32

Since when the error.invalid_method enum variant is available.

Source

pub const ENM__ERROR_NO_MEMORY__SINCE: u32 = 1u32

Since when the error.no_memory enum variant is available.

Source

pub const ENM__ERROR_IMPLEMENTATION__SINCE: u32 = 1u32

Since when the error.implementation enum variant is available.

Trait Implementations§

Source§

impl ConcreteObject for WlDisplay

Source§

const XML_VERSION: u32 = 1u32

The interface version from the XML file that the interface was generated from.
Source§

const INTERFACE: ObjectInterface = ObjectInterface::WlDisplay

The interface of the object.
Source§

const INTERFACE_NAME: &str = "wl_display"

The interface of the object as a string.
Source§

impl Debug for WlDisplay

Source§

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

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

impl Object for WlDisplay

Source§

fn core(&self) -> &ObjectCore

Returns the ObjectCore of this object.
Source§

fn unset_handler(&self)

Unsets the handler of this object. Read more
Source§

fn get_handler_any_ref( &self, ) -> Result<HandlerRef<'_, dyn Any>, HandlerAccessError>

Returns a shared reference to the handler.
Source§

fn get_handler_any_mut( &self, ) -> Result<HandlerMut<'_, dyn Any>, HandlerAccessError>

Returns a mutable reference to the handler.

Auto Trait Implementations§

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<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> ObjectCoreApi for T
where T: Object + ?Sized,

Source§

fn state(&self) -> &Rc<State>

Returns the State of this object.
Source§

fn client(&self) -> Option<Rc<Client>>

Returns the Client associated with this object, if any.
Source§

fn create_child<P>(&self) -> Rc<P>
where P: Object,

Creates a child of this object. Read more
Source§

fn interface(&self) -> ObjectInterface

Returns the ObjectInterface of this object.
Source§

fn version(&self) -> u32

Returns the version of this object.
Source§

fn unique_id(&self) -> u64

Returns the unique ID of this object. Read more
Source§

fn client_id(&self) -> Option<u32>

Returns the client ID of this object, if any.
Source§

fn server_id(&self) -> Option<u32>

Returns the server ID of this object, if any.
Source§

fn delete_id(&self)

Sends a wl_display.delete_id event for this object. Read more
Source§

fn try_delete_id(&self) -> Result<(), ObjectError>

Tries to send a wl_display.delete_id event for this object. Read more
Source§

fn set_forward_to_client(&self, enabled: bool)

Enables or disables automatic forwarding of events to the client. Read more
Source§

fn set_forward_to_server(&self, enabled: bool)

Enables or disables automatic forwarding of requests to the server. Read more
Source§

impl<T> ObjectUtils for T
where T: Object + ?Sized,

Source§

fn try_get_handler_ref<T>( &self, ) -> Result<HandlerRef<'_, T>, HandlerAccessError>
where T: 'static,

Tries to get a shared reference to the handler.
Source§

fn get_handler_ref<T>(&self) -> HandlerRef<'_, T>
where T: 'static,

Gets a shared reference to the handler. Read more
Source§

fn try_get_handler_mut<T>( &self, ) -> Result<HandlerMut<'_, T>, HandlerAccessError>
where T: 'static,

Tries to get a mutable reference to the handler.
Source§

fn get_handler_mut<T>(&self) -> HandlerMut<'_, T>
where T: 'static,

Gets a mutable reference to the handler. Read more
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.