Skip to main content

ClientData

Trait ClientData 

Source
pub trait ClientData:
    Any
    + Send
    + Sync {
    // Provided methods
    fn initialized(&self, _client_id: ClientId) { ... }
    fn disconnected(&self, _client_id: ClientId, _reason: DisconnectReason) { ... }
    fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error> { ... }
}
Expand description

A trait representing your data associated to a client

Provided Methods§

Source

fn initialized(&self, _client_id: ClientId)

Notification that the client was initialized

Source

fn disconnected(&self, _client_id: ClientId, _reason: DisconnectReason)

Notification that the client is disconnected

Source

fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Helper for forwarding a Debug implementation of your ClientData type

By default will just print GlobalHandler { ... }

Trait Implementations§

Source§

impl Debug for dyn ClientData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Implementations on Foreign Types§

Source§

impl ClientData for ()

Implementors§