Crates.io | dota2_api |
lib.rs | dota2_api |
version | 0.2.3 |
source | src |
created_at | 2017-01-22 20:04:19.511771 |
updated_at | 2017-01-27 18:34:09.2844 |
description | Rust client for the official Dota 2 web API |
homepage | |
repository | https://github.com/sbxx/dota2_api |
max_upload_size | |
id | 8177 |
size | 12,132 |
Rust client for the official Dota 2 web API
Nightly is currently required!
extern crate dota2_api;
use dota2_api::Dota2Api;
use dota2_api::models::{SkillLevel, MatchHistoryOptions};
fn main() {
let mut dota = Dota2Api::new("your key here");
let options = MatchHistoryOptions {
matches_requested: Some(10),
skill: Some(SkillLevel::VeryHigh),
..Default::default()
};
let data = dota.get_match_history(Some(&options)).expect("Couldn't get match history");
for m in data.matches {
println!("Match ID: {}, Number of players: {}", m.match_id, m.players.len());
}
}