Trait wayland_server::Resource
[−]
[src]
pub trait Resource { fn ptr(&self) -> *mut wl_resource; unsafe fn from_ptr_new(_: *mut wl_resource) -> Self; unsafe fn from_ptr_initialized(_: *mut wl_resource) -> Self; fn interface_ptr() -> *const wl_interface; fn interface_name() -> &'static str; fn supported_version() -> u32; fn version(&self) -> i32; fn is_alive(&self) -> bool; fn equals(&self, _: &Self) -> bool; }
Common routines for wayland resource objects.
All wayland objects automatically implement this trait as generated by the scanner.
It is mostly used for internal use by the library, and you should only need these methods for interfacing with C library working on wayland objects.
Required Methods
fn ptr(&self) -> *mut wl_resource
Pointer to the underlying wayland proxy object
unsafe fn from_ptr_new(_: *mut wl_resource) -> Self
Create an instance from a wayland pointer
The pointer must refer to a valid wayland resource of the appropriate interface, but that have not yet been seen by the library.
The library will take control of the object (notably overwrite its user_data).
unsafe fn from_ptr_initialized(_: *mut wl_resource) -> Self
Create an instance from a wayland pointer
The pointer must refer to a valid wayland resource of the appropriate interface, and have already been initialized by the library (it'll assume this proxy user_data contains a certain kind of data).
fn interface_ptr() -> *const wl_interface
Pointer to the interface representation
fn interface_name() -> &'static str
Internal wayland name of this interface
fn supported_version() -> u32
Max version of this interface supported
fn version(&self) -> i32
Current version of the interface this resource is instanciated with
fn is_alive(&self) -> bool
Check if the resource behind this handle is actually still alive
fn equals(&self, _: &Self) -> bool
Check of two handles are actually the same wayland object
Returns false
if any of the objects has already been destroyed
Implementors
impl Resource for WlCallback
impl Resource for WlCompositor
impl Resource for WlShmPool
impl Resource for WlShm
impl Resource for WlBuffer
impl Resource for WlDataOffer
impl Resource for WlDataSource
impl Resource for WlDataDevice
impl Resource for WlDataDeviceManager
impl Resource for WlShell
impl Resource for WlShellSurface
impl Resource for WlSurface
impl Resource for WlSeat
impl Resource for WlPointer
impl Resource for WlKeyboard
impl Resource for WlTouch
impl Resource for WlOutput
impl Resource for WlRegion
impl Resource for WlSubcompositor
impl Resource for WlSubsurface