libpobsd
The PlayOnBSD database is a human readable database listing commercial games that can be played on OpenBSD.
The libpobsd provides a Parser to parse the PlayOnBSD database and a GameDataBase to
query the PlayOnBSD database.
Examples
Loading the games (represented by the Game struct) from the database:
use ;
let games = match default
.load_from_file
.expect ;
Loading the games into the GameDataBase:
use ;
let games = match default
.load_from_file
.expect ;
let db = new;
Search games by name:
use ;
let games = match default
.load_from_file
.expect ;
let db = new;
let games = db.search_game_by_name;
Filter a query result (represented by the QueryResult struct)
by year:
use ;
let games = match default
.load_from_file
.expect ;
let db = new;
let games = db.search_game_by_name;
let games = games.get_game_by_year;
List the games of a query result:
use ;
let games = match default
.load_from_file
.expect ;
let db = new;
let games = db.search_game_by_name;
for game in games.into_inner
More examples are available in the documentation of each module.