It would be nice to support Option<T> where T is a simple enum type.
This isn't supported by either ssmarshal or zerocopy. I think we'd want to implement a special zerocopy case like we're doing for bool already. It turns out that the compiler is smart enough to pack None into an unused enum slot, which you can find using
let a: Option<TofinoSeqError> = None;
let a: u8 = unsafe { std::mem::transmute(a) };
It would be nice to support
Option<T>
whereT
is a simple enum type.This isn't supported by either
ssmarshal
orzerocopy
. I think we'd want to implement a specialzerocopy
case like we're doing forbool
already. It turns out that the compiler is smart enough to packNone
into an unused enum slot, which you can find usingso we could use this value for the
None
case.