Associate a struct with every enum variant

· Users Rust Lang · April 17, 2026, 10:18 p.m.
Summary
The post discusses whether it's possible to associate a struct with each variant of an enum in Rust, using a proposed example to illustrate the concept. It raises a question about retrieving struct fields from specific enum variants without providing a definitive solution.
AUTHOR
Sponsored
Zulip logo Zulip
Organized team chat for people who take work seriously. Topic-based threading keeps conversations focused.
Try Zulip
Become a sponsor →