Crate arnak

source ·
Expand description

§arnak

A Rust library for the Board Game Geek XML API.

§Example:

use arnak::BoardGameGeekApi;

// Enter tokio async runtime.
let rt = tokio::runtime::Runtime::new().unwrap();
rt.block_on(async {
    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}"),
    }
})

Structs§

  • Required query paramters. Any type the collection query can implement must be able to return a base query, so valid queries can be constructed for both CollectionItem and CollectionItemBrief.
  • Required query paramters.
  • API for making requests to the Board Game Geek API.
  • A user’s collection on boardgamegeek.
  • Collection endpoint of the API. Used for returning user’s collections of games by their username. Filtering by CollectionItemStatus, rating, recorded plays.
  • A game or game expansion in a collection.
  • An item in a collection, in brief form. With only the name, status, type, and IDs.
  • The 0-10 rating that the user gave to this game. Also includes the total number of users that have rated it, as well as the averages, and standard deviation.
  • The 0-10 rating that the user gave to this game. Also includes the total number of users that have rated it, as well as the averages.
  • Stats of the game such as playercount and duration. Can be omitted from the response. More stats can be found from the specific game endpoint.
  • Stats of the game such as playercount and duration. Can be omitted from the response. More stats can be found from the specific game endpoint.
  • The status of the game in the user’s collection, such as preowned or wishlist. Can be any or none of them.
  • All optional query parameters for making a request to the collection endpoint.
  • A struct containing the game’s rank within a particular type of game.
  • The returned struct containing a list of hot board games.
  • Hot list endpoint of the API. Used for returning the current trending board games.
  • Search endpoint of the API. Used for searching for games by name.
  • All optional query parameters for making a request to the search endpoint.
  • A result when searching for a name. Includes the game’s name, type, and year published.
  • The returned struct containing a list of search results.

Enums§

  • An error returned by the API. This is an enum representing either an http error (reqwest::Error), or an error parsing the output (serde_xml_rs::Error), or finally just a string. Which is typically returned in some case an error shouldn’t happen.
  • The type of game, board game or expansion.
  • A rank a particular board game has on the site, within a subtype. Can be either Ranked with a u64 for the rank, Or NotRanked.
  • The status of the game in the user’s collection, such as preowned or wishlist. Can be any or none of them.

Traits§

Type Aliases§

  • A Result alias where the Err case is arnak::Error.