pub trait FlowKeyExtractor {
// Required method
fn flow_key(
&self,
src: SocketAddr,
payload: &[u8],
cfg: &ClusterConfig,
) -> Option<FlowKey>;
}Expand description
Extracts a FlowKey from an admitted client datagram. The default
SourceTupleExtractor keys on the real client source address (2-tuple
source-IP or 4-tuple source-IP+port per cluster config). The trait is the
only seam for alternative keying (e.g. a QUIC-CID extractor, a non-goal);
the 4-tuple impl is the only one in scope.
Required Methods§
Sourcefn flow_key(
&self,
src: SocketAddr,
payload: &[u8],
cfg: &ClusterConfig,
) -> Option<FlowKey>
fn flow_key( &self, src: SocketAddr, payload: &[u8], cfg: &ClusterConfig, ) -> Option<FlowKey>
Compute the flow key for a datagram from src. Returns None to reject
the datagram (the manager then emits Drop(Invalid) and allocates
nothing). cfg is the listener’s active cluster config.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".