pub struct ClientRegistry { /* private fields */ }Expand description
Contains a mapping of UAID to the associated RegisteredClient.
Implementations§
Source§impl ClientRegistry
impl ClientRegistry
Sourcepub fn with_channel_capacity(channel_capacity: usize) -> Self
pub fn with_channel_capacity(channel_capacity: usize) -> Self
Create a new ClientRegistry with a configurable channel capacity.
Sourcepub fn connect(&self, uaid: Uuid, uid: Uuid) -> Receiver<ServerNotification>
pub fn connect(&self, uaid: Uuid, uid: Uuid) -> Receiver<ServerNotification>
Informs this server that a new client has connected
For now just registers internal state by keeping track of the client,
namely its channel to send notifications back.
Sourcepub fn notify(&self, uaid: Uuid, notif: Notification) -> Result<()>
pub fn notify(&self, uaid: Uuid, notif: Notification) -> Result<()>
A notification has come for the uaid
Sourcepub fn check_storage(&self, uaid: Uuid) -> Result<()>
pub fn check_storage(&self, uaid: Uuid) -> Result<()>
A check for notification command has come for the uaid
Sourcepub fn disconnect(&self, uaid: &Uuid, uid: &Uuid) -> Result<()>
pub fn disconnect(&self, uaid: &Uuid, uid: &Uuid) -> Result<()>
The client specified by uaid has disconnected.
pub fn count(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClientRegistry
impl !RefUnwindSafe for ClientRegistry
impl Send for ClientRegistry
impl Sync for ClientRegistry
impl Unpin for ClientRegistry
impl !UnwindSafe for ClientRegistry
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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