5 releases
0.1.4 | Apr 20, 2020 |
---|---|
0.1.3 | Apr 3, 2020 |
0.1.2 | Apr 3, 2020 |
0.1.1 | Apr 3, 2020 |
0.1.0 | Apr 3, 2020 |
#54 in #api-calls
17KB
428 lines
brawlhalla
Rust wrapper for the Brawlhalla API.
lib.rs
:
brawlhalla - An async Brawlhalla API Wrapper using tokio
With this crate, you can now conveniently call the official Brawlhalla API from Rust! At this point in time, this crate has 100% API coverage, but no additional functionality.
Creating an API Connector
To call the API, you must first create an APIConnection
. To do so, you should use a ConnectionBuilder.
A typical API call would look like this:
extern crate brawlhalla;
use brawlhalla::ConnectionBuilder;
#[tokio::main]
async fn main() -> Result<(), brawlhalla::APIError> {
let conn = ConnectionBuilder::default() // Make a builder struct
.with_apikey("your personal API key") // Configure your API key
.build(); // Create an APIConnection from the template
let legends = conn.legends().await?; // Retrieves data about all legends
println!("{}", legends[0].bio_aka());
Ok(())
}
At this time, the API can only be called via async/tokio.
Dependencies
~8–13MB
~221K SLoC