-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathrest.rs
More file actions
52 lines (45 loc) · 1.33 KB
/
Copy pathrest.rs
File metadata and controls
52 lines (45 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
extern crate irelia;
extern crate serde;
extern crate serde_derive;
extern crate serde_json;
extern crate tokio;
use serde_derive::{Deserialize, Serialize};
#[tokio::main]
async fn main() {
let client = irelia::requests::new();
let lcu_client = irelia::rest::LcuClient::connect_with_request_client(&client).unwrap();
let current_summoner: CurrentSummoner = lcu_client
.get("/lol-summoner/v1/current-summoner")
.await
.unwrap();
println!("{current_summoner:?}");
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CurrentSummoner {
pub account_id: i64,
pub display_name: String,
pub game_name: String,
pub internal_name: String,
pub name_change_flag: bool,
pub percent_complete_for_next_level: i64,
pub privacy: String,
pub profile_icon_id: i64,
pub puuid: String,
pub reroll_points: RerollPoints,
pub summoner_id: i64,
pub summoner_level: i64,
pub tag_line: String,
pub unnamed: bool,
pub xp_since_last_level: i64,
pub xp_until_next_level: i64,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct RerollPoints {
pub current_points: i64,
pub max_rolls: i64,
pub number_of_rolls: i64,
pub points_cost_to_roll: i64,
pub points_to_reroll: i64,
}