decode_event

Function decode_event 

Source
pub fn decode_event(
    cursor: &mut Cursor<&mut BytesMut>,
) -> Result<EventPacket, Error>
Expand description

Decode an event packet sent by F1 2019

F1 2019 extended the event packet with seven new events compared to its predecessor, four of which can carry a payload. A four character event code is provided after the packet header to identify the event. Based on this code the right decoding function is called, and a variant of the EventPacket is returned.