Expand description
§beatsaver-rs
This probject is a Rust library for interacting with the BeatSaver api.
The library is a work in progress and the API has not been stablized, so expect breaking changes.
See also:
§Using the API
use beatsaver_rs::BeatSaverApi;
use beatsaver_rs::client::BeatSaver;
use beatsaver_rs::map::Map;
use bytes::Bytes;
use std::convert::TryInto;
#[tokio::main]
async fn main() {
let client = BeatSaver::new();
let map: Map = client.map(&"1".try_into().unwrap()).await.unwrap();
println!("Map by key: {}", map.name);
let map: Map = client.map(&"fda568fc27c20d21f8dc6f3709b49b5cc96723be".try_into().unwrap()).await.unwrap();
println!("Map by hash: {}", map.name);
let map_download: Bytes = client.download((&map).into()).await.unwrap();
// save map somewhere
}
Modules§
Structs§
- BEATSAVER_
URL - Base URL for the beatsaver API
- Beat
Saver Rate Limit - Structure used for deserializing rate limit errors
- Beat
Saver User - Holds data for a beatsaver user
- Page
- Page metadata for APIs that paginate results
Enums§
- Beat
Saver ApiError - Error that could occur when querying the API
- MapId
- Specifier used to index a map
- MapId
Error - Error type for parsing a Map ID
Traits§
- Beat
Saver Api - API trait for asynchronous clients
- Beat
Saver ApiAsync - API trait for asynchronous clients
Functions§
- rate_
limit - Converts the body of a 429 response to a BeatSaverApiError::RateLimitError