inject_saga_id

Function inject_saga_id 

Source
fn inject_saga_id(cmd: Command, saga_id: u64) -> Command
Expand description

CPD-3 — fill in the saga_id field on a host-bound Command before dispatch. Sagas construct their IssueCmd actions with a placeholder saga_id: 0 (they don’t know their coordinator- allocated id at action-construction time); the coordinator rewrites the field at dispatch time so the host can echo it back on the matching Report*.

Exhaustive match: any host-bound Command variant added later that forgets to plumb saga_id will refuse to compile here. Non-host- bound variants (Report*, Identify, etc.) panic loudly because sagas only emit IssueCmd::Host for the three host-bound command kinds covered below.