pub trait Router: Send + Sync {
// Required method
fn route(
&self,
request: &RouteRequest<'_>,
config: ProxySessionConfig,
) -> Result<ProxySessionConfig, Rejection>;
}Expand description
Decides, for each client, where its session goes and how it runs.
Called once per client, after its handshake and before the relay is
dialled. config is the proxy’s own session configuration; return it,
changed or not, or refuse the client.
Required Methods§
Sourcefn route(
&self,
request: &RouteRequest<'_>,
config: ProxySessionConfig,
) -> Result<ProxySessionConfig, Rejection>
fn route( &self, request: &RouteRequest<'_>, config: ProxySessionConfig, ) -> Result<ProxySessionConfig, Rejection>
Route one client.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".