Variant Payloads
- In the above example, accessing the
char
inKeyPress
, orx
andy
in only works within amatch
or anif let
statement. - It is possible to retrieve the discriminant by calling
std::mem::discriminant()
WebEvent::Click { ... }
is not exactly the same asWebEvent::Click(Click)
with a top level . The inlined version cannot implement traits, for example.