tower_server::tls

Trait TlsConnectionMiddleware

Source
pub trait TlsConnectionMiddleware:
    Clone
    + Send
    + 'static {
    type Data: Send;

    // Required methods
    fn data(&self, connection: &ServerConnection) -> Self::Data;
    fn call(&self, req: &mut Request<Incoming>, data: &Self::Data);
}
Expand description

A middleware for Tls connections.

This middleware is implemented in two steps, first a data extraction step taking a ServerConnection, then a HTTP request middleware runs with that data as a parameter.

Required Associated Types§

Source

type Data: Send

The data extracted from the rustls ServerConnection.

Required Methods§

Source

fn data(&self, connection: &ServerConnection) -> Self::Data

Extract data from a ServerConnection.

Source

fn call(&self, req: &mut Request<Incoming>, data: &Self::Data)

Call middleware with extracted data.

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§