pub struct Client { /* private fields */ }Expand description
A client connected to the proxy.
Clients are usually created by having them connect to an
Acceptor. See State::create_acceptor.
Clients can also be created manually with State::connect and
State::add_client.
Implementations§
Source§impl Client
impl Client
Sourcepub fn set_handler(&self, handler: impl ClientHandler)
pub fn set_handler(&self, handler: impl ClientHandler)
Sets a new handler.
Sourcepub fn set_boxed_handler(&self, handler: Box<dyn ClientHandler>)
pub fn set_boxed_handler(&self, handler: Box<dyn ClientHandler>)
Sets a new, already boxed handler.
Sourcepub fn unset_handler(&self)
pub fn unset_handler(&self)
Unsets the handler.
Sourcepub fn objects(&self, objects: &mut Vec<Rc<dyn Object>>)
pub fn objects(&self, objects: &mut Vec<Rc<dyn Object>>)
Returns all objects associated with this client.
This can be used when a client disconnects to perform cleanup in a multi-client proxy.
Sourcepub fn disconnect(&self)
pub fn disconnect(&self)
Disconnects this client.
The ClientHandler::disconnected event is not emitted.
Sourcepub fn set_suspended(self: &Rc<Self>, suspended: bool)
pub fn set_suspended(self: &Rc<Self>, suspended: bool)
Suspends or unsuspends dispatching messages from the client.
Suspending takes effect immediately. That is, if this is called from within a message handler, no further messages from the client will be dispatched until it is unsuspended.
This can be useful in situations where one clients needs to synchronize with
another. For example, when a client sends wl_surface.commit and another client
needs to take some action before the commit is forwarded to the server.