pub trait Backend: 'static + Debug + Send + Sync {
    type CustomApi: CustomApi;
    type ClientData: Send + Sync + Debug;
    type CustomApiDispatcher: CustomApiDispatcher<Self>;
    fn initialize<'life0, 'async_trait>(
        server: &'life0 CustomServer<Self>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... }
fn client_connected<'life0, 'life1, 'async_trait>(
        client: &'life0 ConnectedClient<Self>,
        server: &'life1 CustomServer<Self>
    ) -> Pin<Box<dyn Future<Output = ConnectionHandling> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
fn client_disconnected<'life0, 'async_trait>(
        client: ConnectedClient<Self>,
        server: &'life0 CustomServer<Self>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... }
fn client_authenticated<'life0, 'async_trait>(
        client: ConnectedClient<Self>,
        server: &'life0 CustomServer<Self>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } }
Expand description

Tailors the behavior of a server to your needs.

Associated Types

The custom API definition. If you do not wish to have an API, () may be provided.

The type of data that can be stored in ConnectedClient::set_client_data. This allows state to be stored associated with each connected client.

The type that implements the Dispatcher trait.

Provided methods

Invoked once upon the server starting up.

A client disconnected from the server. This is invoked before authentication has been performed.

A client disconnected from the server.

A client successfully authenticated.

Implementors