Crate startuppong [−] [src]
An API wrapper for startuppong.com
The wrapper is implemented as a few module level functions for accessing the endpoints. All of the JSON responses are represented with structs. The rustc_serialize crate is heavily relied on to handle decoding of JSON responses.
Sign up for an account at startuppong.com.
Examples
use startuppong::Account; use startuppong::get_players; // Get the current leaderboard let account = Account::new("account_id".to_owned(), "account_key".to_owned()); // Make request to startuppong.com let players_response = get_players(&account).unwrap(); // Consume the response and get the list of players let players = players_response.players(); // Print out the leaderboard for player in &players { println!("{} ({}) - {}", player.rank, player.rating, player.name); }
Modules
error |
Error types, From impls, etc |
Structs
Account |
An account is necessary to make requests against the API. |
GetMatchesResponse |
Wrapper for APIs returning a match list. |
GetPlayersResponse |
Wrapper for APIs returning a player list. |
Match |
The stats before and after a set |
Player |
A person on the ladder |
Functions
account_from_env |
Try and create an account from environment variables |
add_match |
Add a match |
add_match_with_names |
Add a match using the given names. |
get_players |
Return all players associated with the given account |
get_players_ids |
Get ids for players |
get_recent_matches_for_company |
Return most recent matches on the given account |