Module protocol

Module protocol 

Source
Expand description

Protocol implementation for decoding RMonitor messages.

§Example

use rmonitor::protocol::Record;

let data = r#"$A,"1234BE","12X",52474,"John","Johnson","USA",5"#;
let record = Record::decode(&data);

assert!(record.is_ok());
assert!(matches!(record, Ok(Record::Competitor(_))));

if let Ok(Record::Competitor(competitor)) = record {
    assert_eq!(competitor.registration_number, "1234BE");
    assert_eq!(competitor.number, "12X");
    assert_eq!(competitor.transponder_number, 52474);
    assert_eq!(competitor.first_name, "John");
    assert_eq!(competitor.last_name, "Johnson");
    assert_eq!(competitor.nationality, "USA");
    assert_eq!(competitor.class_number, 5);
}

Modules§

command
RMonitor commands are represented in messages by ASCII strings

Structs§

Class
Class information
Competitor
Competitor information record
CompetitorExt
Extended competitor information
Correction
Corrected finish time
Heartbeat
Heartbeat message, sent every second that a session is active
Init
Indicates that the scoreboard should be reset
LineCrossing
Timeline crossing message
Passing
Passing information
PracticeQual
Practice / Qualification position information
Race
Race position information
Run
Run (session) information
Setting
Track setting information
TrackDescription
Track and timeline description message
TrackSection
Track section field

Enums§

Flag
Record
A unit of data from the RMonitor protocol
RecordError
An error occured when decoding a record