pub struct FinalClassification {
pub header: Header,
pub number_of_cars: u8,
pub final_classification_data: Vec<FinalClassificationData>,
}Fields§
§header: Header§number_of_cars: u8§final_classification_data: Vec<FinalClassificationData>Implementations§
Source§impl FinalClassification
impl FinalClassification
Sourcepub fn player_data(&self) -> &FinalClassificationData
pub fn player_data(&self) -> &FinalClassificationData
Examples found in repository?
examples/f1_2020.rs (line 54)
4fn main() {
5 let server =
6 TelemetryServer::<F1_2020>::new("127.0.0.1:20777").expect("failed to bind to address");
7 println!("listening on 127.0.0.1:20777...");
8
9 loop {
10 let event = server.next();
11
12 if let Err(e) = event {
13 println!("error: {:?}", e);
14 continue;
15 }
16
17 match event.unwrap() {
18 F1_2020::Motion(data) => println!(
19 "Motion packet received: {:?}",
20 data.player_data().world_position
21 ),
22 F1_2020::Session(data) => println!(
23 "Session packet received: {:?}, {:?}, {:?}, {:?}",
24 data.formula, data.session_type, data.track, data.weather
25 ),
26 F1_2020::LapData(data) => println!(
27 "LapData packet received: {:?}, {:?}, {:?}",
28 data.player_data().current_lap_time,
29 data.player_data().pit_status,
30 data.player_data().driver_status,
31 ),
32 F1_2020::Event(data) => {
33 println!("Event packet received: {:?}", data.event_data_details)
34 }
35 F1_2020::Participants(data) => println!(
36 "Participants packet received: {:?}",
37 data.player_data().name
38 ),
39 F1_2020::CarSetup(data) => println!(
40 "CarSetups packet received: {:?}",
41 data.player_data().fuel_load
42 ),
43 F1_2020::CarTelemetry(data) => println!(
44 "CarTelemtry packet received: {:?}, {:?}",
45 data.mfd_panel,
46 data.player_data()
47 ),
48 F1_2020::CarStatus(data) => println!(
49 "CarStatus packet received: {:?}",
50 data.player_data().drs_activation_distance
51 ),
52 F1_2020::FinalClassification(data) => println!(
53 "FinalClassification packet received: {:?}",
54 data.player_data()
55 ),
56 F1_2020::LobbyInfo(data) => {
57 println!("LobbyInfo packet received: {:?}", data.players(),)
58 }
59 }
60 }
61}Trait Implementations§
Source§impl BinRead for FinalClassification
impl BinRead for FinalClassification
Source§type Args = ()
type Args = ()
The type of arguments needed to be supplied in order to read this type, usually a tuple. Read more
Source§fn read_options<R: Read + Seek>(
__binread_generated_var_reader: &mut R,
__binread_generated_var_options: &ReadOptions,
__binread_generated_var_arguments: Self::Args,
) -> BinResult<Self>
fn read_options<R: Read + Seek>( __binread_generated_var_reader: &mut R, __binread_generated_var_options: &ReadOptions, __binread_generated_var_arguments: Self::Args, ) -> BinResult<Self>
Read the type from the reader
Source§fn read<R>(reader: &mut R) -> Result<Self, Error>
fn read<R>(reader: &mut R) -> Result<Self, Error>
Read the type from the reader while assuming no arguments have been passed Read more
Source§fn read_args<R>(reader: &mut R, args: Self::Args) -> Result<Self, Error>
fn read_args<R>(reader: &mut R, args: Self::Args) -> Result<Self, Error>
Read the type from the reader using the specified arguments
fn after_parse<R>( &mut self, _: &mut R, _: &ReadOptions, _: Self::Args, ) -> Result<(), Error>
Auto Trait Implementations§
impl Freeze for FinalClassification
impl RefUnwindSafe for FinalClassification
impl Send for FinalClassification
impl Sync for FinalClassification
impl Unpin for FinalClassification
impl UnwindSafe for FinalClassification
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more