Skip to main content

wire_exit_pix

Function wire_exit_pix 

Source
pub(crate) fn wire_exit_pix<WIn, WOut, Chain, S, TFact, G, AppOut, AppIn, TEvt, PixEvt>(
    pipeline_builder: HoprPacketPipelineBuilder<WIn, WOut, Chain, S, TFact, G, AppOut, AppIn, TEvt>,
    ssa_generator: Arc<SsaShareGenerator<HoprPixSpec>>,
    ssa_reconstructor: Arc<SsaReconstructor<HoprPixSpec>>,
    ssa_events: &PixEvt,
    smgr: Arc<SessionManager<CrossfireSink<(DestinationRouting, ApplicationDataOut)>>>,
    processes: &mut AbortableList<HoprTransportProcess>,
) -> (PixToolbox, HoprPacketPipelineBuilder<WIn, WOut, Chain, S, TFact, G, AppOut, AppIn, TEvt, Arc<SsaReconstructor<HoprPixSpec>>, CrossfireSink<HoprShareResolution>>)
where PixEvt: Sink<PixEvent> + Clone + Unpin + Send + 'static, PixEvt::Error: Error + Clone + Sync + Send + 'static,
Expand description

Wires the Exit-side PIX machinery: PixToolbox, the recovered-share channel and the HoprTransportProcess::PixEvents task, returning the toolbox and the pipeline builder with share processing attached.

Shared by the (Exit, Some) and (Relay, Some) arms of run_inner, which differ only in the terminal build_for_* call and the relay’s extra with_ticket_events step. Both need the exact same wiring, and keeping it in one place is not cosmetic: the previous two copies had already drifted, with the comment on the reconstructor config fixed in the Exit copy only.

The reconstructor arrives built, like the generator, so that ssa_reconstructor stays the one place a config turns into one and this stays infallible.

The caller keeps the terminal, so this returns the builder rather than the built processes. Only the exit_ack_proc and ssa_events type parameters change; the rest pass through untouched, which is why none of them carry bounds here.