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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//! [](https://crates.io/crates/rosu) [](https://docs.rs/rosu)
//!
//! # rosu
//!
//! rosu is a rust wrapper for the [osu!api **v1**](https://github.com/ppy/osu-api/wiki) .
//!
//! The wrapper provides access to the beatmap, user, score, user-best, user-recent, and match endpoints.
//!
//! **Note:** Only the osu!api v1 is supported. If you want to use v2, check out [rosu-v2](https://github.com/MaxOhn/rosu-v2).
//!
//! An API key can be generated [here](https://github.com/ppy/osu-api/wiki#requesting-access).
//!
//! ## Examples
//! ```no_run
//! use rosu::{
//! model::*,
//! Osu, OsuResult,
//! };
//! use time::OffsetDateTime;
//!
//! #[tokio::main]
//! async fn main() -> OsuResult<()> {
//! // Initialize the client
//! let osu = Osu::new("osu_api_key");
//!
//! // --- Retrieving top scores ---
//! let mut scores = osu.top_scores("Badewanne3")
//! .mode(GameMode::Mania)
//! .limit(4)
//! .await?;
//! match scores.pop() {
//! Some(score) => {
//! // Retrieve user of the score
//! let user = score.get_user(&osu).mode(GameMode::Osu).await?;
//! // ...
//! }
//! None => println!("No top scores found"),
//! }
//!
//! // --- Retrieving beatmaps ---
//! let mut maps = osu.beatmaps()
//! .mode(GameMode::Mania)
//! .limit(3)
//! .since(OffsetDateTime::from_unix_timestamp(1542150088).unwrap())
//! .mapset_id(945496)
//! .await?;
//! if let Some(map) = maps.pop() {
//! let leaderboard: Vec<Score> = map
//! .get_global_leaderboard(&osu)
//! .limit(13)
//! .await?;
//! // ...
//! }
//! // --- Retrieving user ---
//! let user: Option<User> = osu.user("Badewanne3").await?;
//! // ...
//!
//! // --- Retrieving match ---
//! let osu_match: Match = osu.osu_match(58494587).await?;
//! // ...
//!
//! Ok(())
//! }
//! ```
//! ### Features
//! | Flag | Description | deps |
//! | ----------- | ------------------------------------------------------ | --------------------------------------------------- |
//! | `serialize` | Provides serialization for all types in the `model` module | [serde-repr](https://github.com/dtolnay/serde-repr) |
//! | `metrics` | Make the client count each request type and enable a method on the client to get a `prometheus::IntCounterVec` | [prometheus](https://github.com/tikv/rust-prometheus)
//!
extern crate log;
extern crate bitflags;
/// Contains the Osu client
/// Contains any kind of OsuError that can occur
/// Contains the struct that keeps track of the amount of requests the client does
pub
/// Contains structs that are parsed from the osu!api
/// Re-exporting a bunch of things
/// Contains the ratelimiter for the client
pub
/// Contains the Future structs that request the data
/// Contains the Route enum, responsible for generating the url
/// Contains methods and implementations to (de)serialize structs
pub
pub use ;
pub use ;