Skip to main content

ClientBouncer

Trait ClientBouncer 

Source
pub trait ClientBouncer:
    Clone
    + Sync
    + Send
    + 'static {
    type Tls: MakeTlsConnect<Socket> + Send + Clone + 'static;
    type Future: Future<Output = Result<AcceptConn<Self::Tls>, RejectConn>> + Send + 'static;

    // Required method
    fn handle_startup(&self, info: &StartupData) -> Self::Future;
}
Expand description

A trait for determining if, and where, to route an incoming client connection.

Required Associated Types§

Source

type Tls: MakeTlsConnect<Socket> + Send + Clone + 'static

Source

type Future: Future<Output = Result<AcceptConn<Self::Tls>, RejectConn>> + Send + 'static

Required Methods§

Source

fn handle_startup(&self, info: &StartupData) -> Self::Future

Handles a startup message from a client. Returns a BackendConfig if the connection should be proxied to a backend, or an error if the connection should be rejected.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§