This project introduces an Ergast trait and the main implementation in ErgastClient which can be used to query the
Ergast API.
To query the API you can either use the RequestBuilder or directly provide the URL as a string to the client.
If you are providing your own request string, do not forget to append .json to the query string, otherwise the lib is unable to parse the response.
The client provide some pre-built methods to query * race schedule * qualifying results * sprint qualifying results * race results
rust
let client = ErgastClient::new()?;
let race_results = client
.race_results(None, None)
.await?;
rust
let client = ErgastClient::new()?;
let races = client
.schedule(Some(2020))
.await?;
RequestBuilder```rust let request = RequestBuilder::new() .query(RequestType::QualifyingResult) .addparameter(RequestParameter::Season(2019)) .addparameter(RequestParameter::Round(1)) .build();
let client = ErgastClient::new()?; let qualifying = client .query(request) .await?; ```