Struct wayland_server::Client
[−]
[src]
pub struct Client { /* fields omitted */ }
A handle to a client connected to your server
There can be several handles referring to the same client
Methods
impl Client
[src]
pub unsafe fn from_ptr(ptr: *mut wl_client) -> Client
[src]
Create a client from a wayland-server.so
pointer
pub fn c_ptr(&self) -> *mut wl_client
[src]
Retrieve a pointer to the underlying wl_client
of wayland-server.so
pub fn alive(&self) -> bool
[src]
Check whether this client is still connected to the server
pub fn equals(&self, other: &Client) -> bool
[src]
Check whether this client handle refers to the same client as an other
pub fn flush(&self)
[src]
Flush the pending events to this client
pub fn kill(&self)
[src]
Kills this client
Does nothing if the client is already dead
pub fn set_user_data(&self, data: *mut ())
[src]
Associate an arbitrary payload to this client
The pointer you associate here can be retrieved from any other handle to the same client.
Setting or getting user data is done as an atomic operation. You are responsible for the correct initialization of this pointer, synchronisation of access, and destruction of the contents at the appropriate time.
pub fn get_user_data(&self) -> *mut ()
[src]
Retrieve the arbitrary payload associated to this client
See set_user_data
for explanations.
pub fn set_destructor(&self, destructor: fn(_: *mut ()))
[src]
Set a destructor for this client
the provided function will be called when the client disconnects
or is killed. It's argument is what you would get from calling
get_user_data
.