FinalClassification

Struct FinalClassification 

Source
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

Source

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

Source§

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>

Read the type from the reader
Source§

fn read<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek,

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>
where R: Read + Seek,

Read the type from the reader using the specified arguments
Source§

fn after_parse<R>( &mut self, _: &mut R, _: &ReadOptions, _: Self::Args, ) -> Result<(), Error>
where R: Read + Seek,

Source§

fn args_default() -> Option<Self::Args>

The default arguments to be used when using the read shortcut method. Override this for any type that optionally requries arguments
Source§

impl Debug for FinalClassification

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.