Crates.io | arnak |
lib.rs | arnak |
version | 0.3.0 |
source | src |
created_at | 2024-08-18 22:00:42.454174 |
updated_at | 2024-08-20 22:36:02.77989 |
description | A Rust library for the BoardGameGeek XML API. |
homepage | |
repository | https://github.com/MatthewThompson/arnak |
max_upload_size | |
id | 1343063 |
size | 259,447 |
Rust library for BoardGameGeek XML API bindings.
NOTE: This library is currently in prerelease, not all endpoints have been added and breaking changes could happen often before 1.0.0.
This example uses Tokio, so it would also be needed as a dependency:
[dependencies]
arnak = { version = "0.2.0" }
tokio = { version = "1" }
use arnak::BoardGameGeekApi;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let api = BoardGameGeekApi::new();
let collection = api.collection().get_owned("bluebearbgg").await;
match collection {
Ok(collection) => println!("bluebearbgg owns {} games.", collection.items.len()),
Err(e) => println!("Error: {e}"),
}
Ok(())
}
For a given user, return their collection of board games. This does not just mean games owned by the user, but also ones on their wishlist, previously owned, etc...
Search for a game, returning everything that matches the search. Also includes a search_exact
function that will only return exact name matches.
Returns the top 10 currently trending games.
Some rustfmt options used are nightly only. So to format run cargo +nightly fmt