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.
Auto Trait Implementations§
impl !Freeze for Client
impl !RefUnwindSafe for Client
impl !Send for Client
impl !Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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
Mutably borrows from an owned value. Read more