Crate arnak

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("my_auth_token").expect("something went wrong");
    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§

BaseCollectionQuery
Required query parameters. 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.
BoardGameGeekApi
API for making requests to the Board Game Geek API.
Collection
A user’s collection on boardgamegeek.
CollectionApi
Collection endpoint of the API. Used for returning user’s collections of games by their username. Filtering by crate::CollectionItemStatus, rating, recorded plays.
CollectionItem
A game, game expansion, or game accessory in a collection.
CollectionItemBrief
An item in a collection, in brief form. With the name, status, type, and IDs, also a brief version of the game stats.
CollectionItemRating
The 0-10 rating that the user gave to this item. Also includes the total number of users that have rated it, as well as the averages, and standard deviation.
CollectionItemRatingBrief
The 0-10 rating that the user gave to this item. Also includes the total number of users that have rated it, as well as the averages.
CollectionItemStats
Stats of the game such as the player count and duration. Can be omitted from the response. More stats can be found from the specific game endpoint.
CollectionItemStatsBrief
Stats of the game such as player count and duration. Can be omitted from the response. More stats can be found from the specific game endpoint.
CollectionItemStatus
The status of the item in the user’s collection, such as preowned or wishlist. Can be any or none of them.
CollectionQueryParams
All optional query parameters for making a request to the collection endpoint.
Dimensions
The dimensions of a game, in inches.
Game
A game with minimal information, only the name and ID.
GameAccessory
A game accessory with minimal information, only the name and ID.
GameApi
Game endpoint for the API.
GameArtist
An artist for a game.
GameCategory
A game accessory with minimal information, only the name and ID.
GameCompilation
A different edition or compilation of a game.
GameDesigner
A designer of a game.
GameDetails
A game, or expansion, with full details.
GameFamily
A family of games in a particular series or group. Contains the description for the family as well as the list of games.
GameFamilyApi
Game family endpoint of the API. Used for searching for game families by ID.
GameFamilyName
A name and ID of a game family.
GameImplementation
A re-implementation of a game.
GameMechanic
A game accessory with minimal information, only the name and ID.
GamePublisher
A publisher of a game.
GameQueryParams
All optional query parameters for making a request to the game endpoint.
GameStats
Various statistics for the game, including the number of users who own the game as well as the ratings.
GameVersion
Information about a game which is a version or re-implementation of another game, including the link to the original.
Guild
A struct with information for a guild, returned by the guild endpoint of the API. If requested it can also return the guild members, but only up to 25 at a time.
GuildApi
Endpoint for getting guilds by their ID.
GuildQueryParams
Optional query parameters that can be made when retrieving guilds.
HotListApi
Hot list endpoint of the API. Used for returning the current trending board games.
HotListGame
An game on the hot list, has the rank from 1 to 50 on the list, as well as some basic information about the game like the name and year published.
ItemFamilyRank
A struct containing the game’s rank within a particular type of game.
Language
A language, listed on versions of games that may support one or more languages.
LanguageDependence
A suggested minimum player age, along with how many users voted for this age.
LanguageDependencePoll
A user answered poll for how playable the game would be, should the player not speak the language.
Location
A location of a guild. It is optional to set so some or all values may be empty strings.
MarketplaceListing
A game sale listing, for people selling games on the site.
Member
A member of a guild.
MemberPage
A page of members in a particular guild, up to 25.
Price
The price of a game in a marketplace listing.
RatingComment
A comment left on a game by a user. Can include a rating or a text comment or both.
RatingCommentPage
A page of comments left on a game by a user. Can include a rating or a text comment or both.
SearchApi
Search endpoint of the API. Used for searching for games and other items by name.
SearchResult
A result when searching for a name. Includes the game’s name, type, and year published.
SuggestedPlayerAge
A suggested minimum player age, along with how many users voted for this age.
SuggestedPlayerAgePoll
A user answered poll for the minimum player age this game is best suited for.
SuggestedPlayerCount
A suggested player count, along with community votes as to whether it is recommended or not.
SuggestedPlayerCountPoll
A user answered poll for how many players this game is best suited for.
User
A user’s username and ID.
Video
A video relating to a game.

Enums§

CollectionItemType
The type of an item that can be returned from the collections endpoint. Either a board game, a board game expansion, or board game accessory, a subset ot ItemType.
Error
An error returned by the API.
GameCondition
The condition of a game for sale.
GameType
The type of a game.
GuildMemberSortBy
Which field to sort the list of members by, either username or date joined.
ItemType
The type of the item. Either a board game, a board game expansion, or board game accessory.
NameType
The type of game, board game or expansion.
PlayerAge
A minimum suitable age for playing a game.
PlayerCount
A number of players for the purpose of voting on what the best player count for a game may be.
RankValue
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.
RatingValue
A Bayesian average rating of a boardgame in its family. Either valued as a f64, or NotRanked.
VideoCategory
Type of video for a video related to a particular game.
WishlistPriority
The status of the item in the user’s collection, such as preowned or wishlist. Can be any or none of them.

Traits§

CollectionType
Trait for a type that the collection endpoint can return. Allows us to get values for the mandatory query params for the different types.

Type Aliases§

Result
A std::result::Result alias where the Err case is Error.