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]
impl Client
pub fn alive(&self) -> bool
[src]
pub fn alive(&self) -> bool
Check whether this client is still connected to the server
pub fn equals(&self, other: &Client) -> bool
[src]
pub fn equals(&self, other: &Client) -> bool
Check whether this client handle refers to the same client as an other
pub fn flush(&self)
[src]
pub fn flush(&self)
Flush the pending events to this client
pub fn kill(&self)
[src]
pub fn kill(&self)
Kills this client
Does nothing if the client is already dead
pub fn data_map(&self) -> &UserDataMap
[src]
pub fn data_map(&self) -> &UserDataMap
Access the map handling user data associated to this client
See UserDataMap
documentation for details about its use.
pub fn add_destructor<F: FnOnce(&UserDataMap) + Send + 'static>(
&self,
destructor: F
)
[src]
pub fn add_destructor<F: FnOnce(&UserDataMap) + Send + 'static>(
&self,
destructor: F
)
Add a destructor for this client
This closure will be called when the client disconnects or is killed, It has access to the user data map associated to this client.
You can add several destructors which will all be called sequentially. Note that if you accidentally add two copies of the same closure, it'll be called twice.
The destructors will be executed on the thread containing the wayland event loop.
pub fn create_resource<I: Interface>(
&self,
version: u32
) -> Option<NewResource<I>>
[src]
pub fn create_resource<I: Interface>(
&self,
version: u32
) -> Option<NewResource<I>>
Create a new resource for this client
To ensure the state coherence between client and server, this resource should immediatly be implemented and sent to the client through and appropriate event. Failure to do so will likely cause protocol errors.