8 releases
0.4.0 | Jan 18, 2024 |
---|---|
0.3.2 | Oct 24, 2023 |
0.3.0 | Dec 28, 2022 |
0.2.0 | Dec 29, 2020 |
0.1.2 | Dec 23, 2019 |
#1224 in Network programming
785 downloads per month
Used in livesplit-core
69KB
1.5K
SLoC
splits-io-api
Bindings to the splits.io API for Rust. Both native platforms and the web are supported.
Example Usage
// Create a splits.io API client.
let client = Client::new();
// Search for a runner.
let runner = Runner::search(&client, "cryze")
.await?
.into_iter()
.next()
.context("There is no runner with that name")?;
assert_eq!(&*runner.name, "cryze92");
// Get the PBs for the runner.
let first_pb = runner.pbs(&client)
.await?
.into_iter()
.next()
.context("This runner doesn't have any PBs")?;
// Get the game for the PB.
let game = first_pb.game.context("There is no game for the PB")?;
assert_eq!(&*game.name, "The Legend of Zelda: The Wind Waker");
// Get the categories for the game.
let categories = game.categories(&client).await?;
// Get the runs for the Any% category.
let runs = categories
.iter()
.find(|category| &*category.name == "Any%")
.context("Couldn't find category")?
.runs(&client)
.await?;
assert!(!runs.is_empty());
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.
Dependencies
~5–20MB
~235K SLoC