Due to how the variants of MessageKind and ADSBMessageKind are built, they are pretty easy to create, but from a user of the API's perspective, due to the individual variants being Enums, they cannot be typed and assigned to new variables.
I'd suggest to convert messageKinds into individual types, but they consumes a common trait that can still be extended using impl on both of these types for creation purposes. This is particularly impactful on the enum variants that have highly differing contents and sub-fields. By implementing this, in theory you could then the following which is not really possible as Enums aren't types:
let packet = parse_avr(&input).unwrap();
let adsb: ADSBMessage = packet.kind;
let postition: Position = adsb.kind.cpr_frame.position;
Due to how the variants of MessageKind and ADSBMessageKind are built, they are pretty easy to create, but from a user of the API's perspective, due to the individual variants being Enums, they cannot be typed and assigned to new variables.
I'd suggest to convert messageKinds into individual types, but they consumes a common trait that can still be extended using impl on both of these types for creation purposes. This is particularly impactful on the enum variants that have highly differing contents and sub-fields. By implementing this, in theory you could then the following which is not really possible as Enums aren't types: