Skip to main content

split

Function split 

Source
fn split(side: ProxySide) -> (Leg, Direction)
Expand description

The connection a side’s traffic is travelling over, and the way it is going — the pair ProxyStats::per_leg is indexed by.

A ProxySide is exactly this pair: transport.rs says so in prose, that ClientToProxy and ProxyToClient are the two directions of the client leg and ProxyToRelay and RelayToProxy the two of the upstream leg, and this is that sentence written as a total function. Written out arm by arm rather than composed from Direction::from and a second mapping, because the four arms are the definition and a reader checking the attribution should not have to compose two functions to see it.