pogo-masterfile
Runtime API for the Pokémon GO masterfile. Loads, indexes, and queries entries with per-group narrow-typed accessors. Built on pogo-masterfile-types.
Install
For sync usage:
Quickstart
use Masterfile;
use MoveSettingsTemplateId;
# block_on;
Top-level vs per-group lookups
The Masterfile struct splits its lookup APIs to match Rust's idioms:
- Top-level (
mf.get_entry,mf.has) returns&MasterfileEntry(the wide enum). Use it for arbitrary string IDs. - Per-group accessor (
mf.move_settings().get(id)) narrows to the exact&MoveSettingsEntrystruct. Theidparameter is polymorphic (impl TryInto<MoveSettingsTemplateId>) — accepts both the typed enum (compile-time validated) and&str(runtime-parsed):
use MoveSettingsTemplateId;
// Typed: compile-time validated.
let m = mf.move_settings.get;
// String: runtime parsed. Returns None if the string doesn't parse OR the
// entry is missing.
let m = mf.move_settings.get;
Loading
use Duration;
use Masterfile;
# block_on;
Async vs blocking
Both APIs ship in the same crate, gated by Cargo features. The async API is on by default; the blocking API is opt-in.
// Async (default)
use Masterfile;
// Blocking (feature = "blocking")
use Masterfile;
The struct API is identical between the two — only from_remote and refresh change shape (sync vs async).
Errors
Five real failure modes, surfaced through the Error enum:
match err
For lookups, Option<&Entry> carries the "not found" case — no exception path.
Source
Generated from the codegen pipeline at the repo root. Don't edit emitted files — re-run bun run generate instead.
License
MIT — see LICENSE.