Join Nostr
2026-01-27 20:21:56 UTC

musicmatze :rust: :nixos: on Nostr: Ok so here's my current #rust problem. I have an enum, each variant has a struct: ...

Ok so here's my current #rust problem.

I have an enum, each variant has a struct: `enum E { A(A), B(B), ... }`. This is what my tool receives via network. I have `Service` impls, but not for `A` and `B`, but for `A'` and `B'`.

The enum variant types can be mapped into what the services receive.

The response type of each service can also be mapped into a response enum variant (same thing like above, but reverse).

How do I build a generic router for this?

#rust #rustlang