Bindings to the Splits.io API for Rust. Both native platforms and the web are supported.
```rust // Create a Splits.io API client. let client = Client::new();
// Search for a runner. let runners = runner::search(&client, "cryze").await.unwrap(); let runner = runners.first().unwrap(); let runnername = &*runner.name; asserteq!(runner_name, "cryze92");
// Get the PBs for the runner. let runnerpbs = runner::getpbs(&client, runnername).await.unwrap(); let firstpb = &*runner_pbs.first().unwrap();
// Get the game for the PB. let pbgame = firstpb.game.asref().unwrap(); let pbgameshortname = pbgame.shortname.asref().unwrap(); asserteq!(pbgameshortname.as_ref(), "tww");
// Get the categories for the game. let gamecategories = game::getcategories(&client, pbgameshortname).await.unwrap();
// Get the runs for the Any% category. let anypercent = gamecategories.iter().find(|category| &*category.name == "Any%").unwrap(); let anypercentruns = category::getruns(&client, &anypercent.id).await.unwrap(); assert!(!anypercentruns.is_empty()); ```
Licensed under either of
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.