pub trait ProxyRouter: Send + Sync {
// Required method
fn route(&self, host: &str, port: u16) -> Result<RouteDecision, ProxyError>;
}Expand description
Pluggable routing policy. Implementations must be Send + Sync so the
server can hold an Arc<dyn ProxyRouter>.
Required Methods§
Sourcefn route(&self, host: &str, port: u16) -> Result<RouteDecision, ProxyError>
fn route(&self, host: &str, port: u16) -> Result<RouteDecision, ProxyError>
Decide how to handle a CONNECT to host:port.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".