I’ve been working on modelling the PCI configuration space and would really like to be able to control the mapping of
Firstly, the PCI Interrupt Pin has 5 values:-
0x00 - None
0x01 to 0x04 - Something meaningful.
I can’t use an enum to represent this as Option, even if enum SomethingMeaningful is repr(u8), as Rust maps None to a value of 0x05! This means one can’t use an enum here that re-uses Rust’s Option type. Is there anything experimental in the works?
Secondly, I have a number of types where the situation is reversed, and 0xFF is None. I’d really like a NonZeroFF type, but failing that, it would be nice to likewise have an enum. Using new type wrappers id, of course, quite do-able, but it doesn’t exactly model the situation I want.
Anything in the works here? Anything the Rust lang has got experimentally?