[][src]Crate splits_io_api

splits-io-api is a library that provides bindings for the Splits.io API for 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 runner_name = &*runner.name;
assert_eq!(runner_name, "cryze92");

// Get the PBs for the runner.
let runner_pbs = runner::get_pbs(&client, runner_name).await.unwrap();
let first_pb = &*runner_pbs.first().unwrap();

// Get the game for the PB.
let pb_game = first_pb.game.as_ref().unwrap();
let pb_game_shortname = pb_game.shortname.as_ref().unwrap();
assert_eq!(pb_game_shortname.as_ref(), "tww");

// Get the categories for the game.
let game_categories = game::get_categories(&client, pb_game_shortname).await.unwrap();

// Get the runs for the Any% category.
let any_percent = game_categories.iter().find(|category| &*category.name == "Any%").unwrap();
let any_percent_runs = category::get_runs(&client, &any_percent.id).await.unwrap();
assert!(!any_percent_runs.is_empty());

Re-exports

pub use uuid;

Modules

category

The category module handles retrieving Categories. A Category is a ruleset for a Game and may contain Runs.

game

The game module handles retrieving Games. A Game is a collection of information about a game and may contain Categories.

race

The race module handles retrieving Races. A Race is a competition between multiple Runners.

run

The run module handles retrieving Runs. A Run maps directly to an uploaded splits file.

runner

The runner module handles retrieving Runners. A Runner is a user with at least one Run tied to their Splits.io account.

Structs

Attachment

A file that is attached to a Race.

Category

A Category is a ruleset for a Game (Any%, 100%, MST, etc.) and an optional container for Runs.

ChatMessage

A Chat Message is a shortform message sent by a user to a Race

Client

A client that can access the Splits.io API. This includes an access token that is used for authentication to all API endpoints.

Entry

An Entry represents a Runner's participation in a Race or a ghost of a past Run.

Game

A Game is a collection of information about a game, and a container for Categories.

Race

A Race is a live competition between multiple Runners who share a start time for their run.

Run

A Run maps 1:1 to an uploaded splits file.

RunItemHistories

Information about a past attempt associated with a Run.

Runner

A Runner is a user who has at least one run tied to their account.

Segment

A Segment maps to a single piece of a run, also called a split.

SegmentItemHistories

Information about a past attempt of a segment.

Enums

Error

An error when making an API request.

Visibility

The permission set for a Race.