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

    // Required method
    fn handle_connection(
        &self,
        conn: TcpStream
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>;
}
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: TcpStream ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>

Handles a single connection.

Implementations on Foreign Types§

source§

impl Server for Server

source§

const NAME: &'static str = "pgwire"

source§

fn handle_connection( &self, conn: TcpStream ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>

Implementors§

source§

impl Server for HttpServer

source§

const NAME: &'static str = "http"

source§

impl Server for InternalHttpServer

source§

const NAME: &'static str = "internal_http"