Join Nostr
2026-01-27 21:24:34 UTC
in reply to

chrysn on Nostr: I think in general you can't, you'll need methods like fn as_service(&self) { match ...

I think in general you can't, you'll need methods like

fn as_service(&self) {
match self {
MyThing::A(a) => Service::APrime(a.into()),
...
}
}

etc.

If you don't want to create them on foot, macros make this reasonably easy.