How to force a union to behave as if there is only one type?
问题 I'm trying to write a wrapper for the epoll Linux API. I forked this repository, but this crate doesn't use the union type used by the epoll API. I decided to use Rust's C union feature to create a complete wrapper where user will not need to use unsafe code. This union causes me some trouble. How could I lock the used type of the union to one type at compile time? epoll's union can't be differentiated; you can only use one member of the union by epoll fd. Well, you can but that will not be