Trait Server

Source
pub trait Server {
    const NAME: &'static str;

    // Required method
    fn handle_connection(
        &self,
        conn: Connection,
        tokio_metrics_intervals: impl Iterator<Item = TaskMetrics> + Send + 'static,
    ) -> ConnectionHandler;
}
Expand description

A server handles incoming network connections.

Required Associated Constants§

Source

const NAME: &'static str

Returns the name of the connection handler for use in e.g. log messages.

Required Methods§

Source

fn handle_connection( &self, conn: Connection, tokio_metrics_intervals: impl Iterator<Item = TaskMetrics> + Send + 'static, ) -> ConnectionHandler

Handles a single connection.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§