pub struct Client { /* private fields */ }Expand description
Proxy that represents a client that is connected to the server.
Implementations§
Source§impl Client
impl Client
Sourcepub fn add_listener(&self, events: ClientEvents) -> HookId
pub fn add_listener(&self, events: ClientEvents) -> HookId
Register for notifications of client events.
Sourcepub fn remove_listener(&self, hook_id: HookId)
pub fn remove_listener(&self, hook_id: HookId)
Remove a set of event listeners.
Sourcepub fn error(&self, id: u32, res: u32, message: &str) -> Result<()>
pub fn error(&self, id: u32, res: u32, message: &str) -> Result<()>
Signal an error to the client.
Sourcepub fn permissions(&self, index: u32, num: u32) -> Result<()>
pub fn permissions(&self, index: u32, num: u32) -> Result<()>
Retrieve permissions of a client.
Sourcepub fn update_permissions(&self, permissions: &[Permission]) -> Result<()>
pub fn update_permissions(&self, permissions: &[Permission]) -> Result<()>
Update permissions of a client.
Trait Implementations§
Source§impl Refcounted for Client
impl Refcounted for Client
Source§type WeakRef = WeakClient
type WeakRef = WeakClient
The type of a weak reference to the object
Source§fn upgrade(this: &Self::WeakRef) -> Option<Self>
fn upgrade(this: &Self::WeakRef) -> Option<Self>
Try to convert a weak reference to a strong reference. If the underlying object isstill
alive, returns a
Some continaing the value. If the underlying object’s strong reference
count dropped to zero, and was thus freed, this returns None.Source§fn downgrade(&self) -> Self::WeakRef
fn downgrade(&self) -> Self::WeakRef
Create a weak reference to the object. This reference does not impact the object’s
lifecycle, and merely allows us the option to try to retrieve the object using
Self::upgrade().
impl Send for Client
impl Sync for Client
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Unpin for Client
impl UnsafeUnpin 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