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
impl WlDisplay
Sourcepub fn set_handler(&self, handler: impl WlDisplayHandler)
pub fn set_handler(&self, handler: impl WlDisplayHandler)
Sets a new handler.
Sourcepub fn set_boxed_handler(&self, handler: Box<dyn WlDisplayHandler>)
pub fn set_boxed_handler(&self, handler: Box<dyn WlDisplayHandler>)
Sets a new, already boxed handler.
Source§impl WlDisplay
impl WlDisplay
Sourcepub const MSG__SYNC__SINCE: u32 = 1u32
pub const MSG__SYNC__SINCE: u32 = 1u32
Since when the sync message is available.
Sourcepub const MSG__GET_REGISTRY__SINCE: u32 = 1u32
pub const MSG__GET_REGISTRY__SINCE: u32 = 1u32
Since when the get_registry message is available.
Sourcepub const MSG__ERROR__SINCE: u32 = 1u32
pub const MSG__ERROR__SINCE: u32 = 1u32
Since when the error message is available.
Sourcepub const MSG__DELETE_ID__SINCE: u32 = 1u32
pub const MSG__DELETE_ID__SINCE: u32 = 1u32
Since when the delete_id message is available.
Sourcepub fn try_send_sync(
&self,
callback: &Rc<WlCallback>,
) -> Result<(), ObjectError>
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
Sourcepub fn send_sync(&self, callback: &Rc<WlCallback>)
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
Sourcepub fn new_try_send_sync(&self) -> Result<Rc<WlCallback>, ObjectError>
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.
Sourcepub fn new_send_sync(&self) -> Rc<WlCallback>
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.
Sourcepub fn try_send_get_registry(
&self,
registry: &Rc<WlRegistry>,
) -> Result<(), ObjectError>
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
Sourcepub fn send_get_registry(&self, registry: &Rc<WlRegistry>)
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
Sourcepub fn new_try_send_get_registry(&self) -> Result<Rc<WlRegistry>, ObjectError>
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.
Sourcepub fn new_send_get_registry(&self) -> Rc<WlRegistry>
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.
Sourcepub fn try_send_error(
&self,
object_id: Rc<dyn Object>,
code: u32,
message: &str,
) -> Result<(), ObjectError>
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 occurredcode: error codemessage: error description
Sourcepub fn send_error(&self, object_id: Rc<dyn Object>, code: u32, message: &str)
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 occurredcode: error codemessage: error description
Sourcepub fn try_send_delete_id(&self, id: u32) -> Result<(), ObjectError>
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
Sourcepub fn send_delete_id(&self, id: u32)
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
impl WlDisplay
Sourcepub const ENM__ERROR_INVALID_OBJECT__SINCE: u32 = 1u32
pub const ENM__ERROR_INVALID_OBJECT__SINCE: u32 = 1u32
Since when the error.invalid_object enum variant is available.
Sourcepub const ENM__ERROR_INVALID_METHOD__SINCE: u32 = 1u32
pub const ENM__ERROR_INVALID_METHOD__SINCE: u32 = 1u32
Since when the error.invalid_method enum variant is available.
Sourcepub const ENM__ERROR_NO_MEMORY__SINCE: u32 = 1u32
pub const ENM__ERROR_NO_MEMORY__SINCE: u32 = 1u32
Since when the error.no_memory enum variant is available.
Sourcepub const ENM__ERROR_IMPLEMENTATION__SINCE: u32 = 1u32
pub const ENM__ERROR_IMPLEMENTATION__SINCE: u32 = 1u32
Since when the error.implementation enum variant is available.
Trait Implementations§
Source§impl ConcreteObject for WlDisplay
impl ConcreteObject for WlDisplay
Source§const XML_VERSION: u32 = 1u32
const XML_VERSION: u32 = 1u32
Source§const INTERFACE: ObjectInterface = ObjectInterface::WlDisplay
const INTERFACE: ObjectInterface = ObjectInterface::WlDisplay
Source§const INTERFACE_NAME: &str = "wl_display"
const INTERFACE_NAME: &str = "wl_display"
Source§impl Object for WlDisplay
impl Object for WlDisplay
Source§fn core(&self) -> &ObjectCore
fn core(&self) -> &ObjectCore
ObjectCore of this object.Source§fn unset_handler(&self)
fn unset_handler(&self)
Source§fn get_handler_any_ref(
&self,
) -> Result<HandlerRef<'_, dyn Any>, HandlerAccessError>
fn get_handler_any_ref( &self, ) -> Result<HandlerRef<'_, dyn Any>, HandlerAccessError>
Source§fn get_handler_any_mut(
&self,
) -> Result<HandlerMut<'_, dyn Any>, HandlerAccessError>
fn get_handler_any_mut( &self, ) -> Result<HandlerMut<'_, dyn Any>, HandlerAccessError>
Auto Trait Implementations§
impl !Freeze for WlDisplay
impl !RefUnwindSafe for WlDisplay
impl !Send for WlDisplay
impl !Sync for WlDisplay
impl Unpin for WlDisplay
impl !UnwindSafe for WlDisplay
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ObjectCoreApi for T
impl<T> ObjectCoreApi for T
Source§fn client(&self) -> Option<Rc<Client>>
fn client(&self) -> Option<Rc<Client>>
Client associated with this object, if any.Source§fn interface(&self) -> ObjectInterface
fn interface(&self) -> ObjectInterface
ObjectInterface of this object.